From dd95096bfa53dc1761f6edbfb1e1b73f315cc53e Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sat, 17 Oct 2020 18:20:05 +0200 Subject: [PATCH] Smart Fluid Pipes - Added craftable pipes with filtering capabilities - Added missing recipe for the Portable Storage Interface --- src/generated/resources/.cache/cache | 29 ++- .../assets/create/blockstates/fluid_pipe.json | 204 +++++++++--------- .../create/blockstates/smart_fluid_pipe.json | 57 +++++ .../resources/assets/create/lang/en_ud.json | 1 + .../resources/assets/create/lang/en_us.json | 2 + .../assets/create/lang/unfinished/de_de.json | 4 +- .../assets/create/lang/unfinished/fr_fr.json | 4 +- .../assets/create/lang/unfinished/it_it.json | 4 +- .../assets/create/lang/unfinished/ja_jp.json | 4 +- .../assets/create/lang/unfinished/ko_kr.json | 4 +- .../assets/create/lang/unfinished/nl_nl.json | 4 +- .../assets/create/lang/unfinished/pt_br.json | 4 +- .../assets/create/lang/unfinished/ru_ru.json | 4 +- .../assets/create/lang/unfinished/zh_cn.json | 4 +- .../create/models/item/smart_fluid_pipe.json | 3 + .../kinetics/portable_storage_interface.json | 32 +++ .../crafting/kinetics/smart_fluid_pipe.json | 32 +++ .../loot_tables/blocks/smart_fluid_pipe.json | 19 ++ .../kinetics/portable_storage_interface.json | 18 ++ .../crafting/kinetics/smart_fluid_pipe.json | 22 ++ .../java/com/simibubi/create/AllBlocks.java | 11 + .../java/com/simibubi/create/AllShapes.java | 18 ++ .../com/simibubi/create/AllTileEntities.java | 7 + .../fluids/pipes/AxisPipeBlock.java | 8 +- .../fluids/pipes/FluidValveBlock.java | 7 +- .../fluids/pipes/FluidValveTileEntity.java | 29 +-- .../contraptions/fluids/pipes/IAxisPipe.java | 19 ++ .../fluids/pipes/SmartFluidPipeBlock.java | 156 ++++++++++++++ .../fluids/pipes/SmartFluidPipeGenerator.java | 34 +++ .../pipes/SmartFluidPipeTileEntity.java | 97 +++++++++ .../fluids/pipes/StraightPipeTileEntity.java | 20 +- .../logistics/item/filter/FilterItem.java | 41 ++++ .../data/recipe/StandardRecipeGen.java | 14 ++ .../filtering/FilteringBehaviour.java | 12 ++ .../filtering/FilteringRenderer.java | 8 +- .../assets/create/lang/default/messages.json | 1 + .../models/block/smart_fluid_pipe/block.json | 72 +++++++ .../models/block/smart_fluid_pipe/item.json | 96 +++++++++ .../create/textures/block/smart_pipe_1.png | Bin 0 -> 363 bytes .../create/textures/block/smart_pipe_2.png | Bin 0 -> 402 bytes 40 files changed, 942 insertions(+), 163 deletions(-) create mode 100644 src/generated/resources/assets/create/blockstates/smart_fluid_pipe.json create mode 100644 src/generated/resources/assets/create/models/item/smart_fluid_pipe.json create mode 100644 src/generated/resources/data/create/advancements/recipes/create.base/crafting/kinetics/portable_storage_interface.json create mode 100644 src/generated/resources/data/create/advancements/recipes/create.base/crafting/kinetics/smart_fluid_pipe.json create mode 100644 src/generated/resources/data/create/loot_tables/blocks/smart_fluid_pipe.json create mode 100644 src/generated/resources/data/create/recipes/crafting/kinetics/portable_storage_interface.json create mode 100644 src/generated/resources/data/create/recipes/crafting/kinetics/smart_fluid_pipe.json create mode 100644 src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/IAxisPipe.java create mode 100644 src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/SmartFluidPipeBlock.java create mode 100644 src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/SmartFluidPipeGenerator.java create mode 100644 src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/SmartFluidPipeTileEntity.java create mode 100644 src/main/resources/assets/create/models/block/smart_fluid_pipe/block.json create mode 100644 src/main/resources/assets/create/models/block/smart_fluid_pipe/item.json create mode 100644 src/main/resources/assets/create/textures/block/smart_pipe_1.png create mode 100644 src/main/resources/assets/create/textures/block/smart_pipe_2.png diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 7b3af88bc..3c3ebbe8e 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -338,6 +338,7 @@ b6e50f46a02f833f2f2bafa8585a909b6da5e229 assets/create/blockstates/scoria_cobble 81931eb1027dfb42ba4b2186185a4c0a36e0dbe4 assets/create/blockstates/sequenced_gearshift.json c4c3613ad353e721e7109628aa06ab0664d0862b assets/create/blockstates/shadow_steel_casing.json 79ae6d86a829b9ce82fce68a6377d3810fcfcb10 assets/create/blockstates/shaft.json +f0f72cc1faacc8f37c8ac1833c22eb910771c800 assets/create/blockstates/smart_fluid_pipe.json e815bfd854c2653f10828bb11950f7fb991d7efc assets/create/blockstates/speedometer.json 1cb7cdbefa0ff199263782809287854b9d85074c assets/create/blockstates/spout.json d62b7908119fa4f51715a186d0882b388bb25cab assets/create/blockstates/spruce_window.json @@ -367,17 +368,17 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j 6801fa1f466f172700e573e5b8ee8ee5f9ca4583 assets/create/blockstates/yellow_valve_handle.json 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json -82524600ca83a766522129634a44b47a277a4b71 assets/create/lang/en_ud.json -ceb95c9ec33c0fd8d377a6b7589948d7a2c307b5 assets/create/lang/en_us.json -34e9e276f2e082bb20f3f78662d4ba2d77b2a41d assets/create/lang/unfinished/de_de.json -c7dcd1eea54c09dd0433eb92a529ac99551b29be assets/create/lang/unfinished/fr_fr.json -2cdedaba849e30ed2237f02d36b135f41800119e assets/create/lang/unfinished/it_it.json -665ae9fa760c7cef399e962c6f8c4eedd018c91f assets/create/lang/unfinished/ja_jp.json -4171e22d172669d2d484c4dcbf585cc8c45a15b5 assets/create/lang/unfinished/ko_kr.json -3d82d42dba4d700d1a95b48390c25aa07d4a0939 assets/create/lang/unfinished/nl_nl.json -e848ccedee3b2df7830736055808e84a0b26bbb8 assets/create/lang/unfinished/pt_br.json -ebd0aa7eced5d3f87e541f61d589220a147c6fae assets/create/lang/unfinished/ru_ru.json -8373638521a2e51ed52ff055c7b0f60795411c08 assets/create/lang/unfinished/zh_cn.json +ec6eb28b76106e24adb255e49943da3f53196bfb assets/create/lang/en_ud.json +f719ad41c8be237bbbafa8fabd8fda2b47288a31 assets/create/lang/en_us.json +5f8522c527cbbe50e33a7774316988fa6077d78d assets/create/lang/unfinished/de_de.json +0473893175500c6fd3f5410b575fc6ffc3abbb28 assets/create/lang/unfinished/fr_fr.json +c9fb5f2769f3e9be347bcd34b21a6c961e9a2324 assets/create/lang/unfinished/it_it.json +9bf0b4231a4f3d58b31fdb8d9876c8fdb40c5df5 assets/create/lang/unfinished/ja_jp.json +d7bd07920ecca15c2fe0728b141b3a9230ab545f assets/create/lang/unfinished/ko_kr.json +71c6d13fd8b300c851a591b76b32eff442acf586 assets/create/lang/unfinished/nl_nl.json +1668581de8b7ff54bb8cf2d705faa07936d2d8fd assets/create/lang/unfinished/pt_br.json +891d5a4abd250d7901a3a3df4907722e8ef864e9 assets/create/lang/unfinished/ru_ru.json +ef6159365f4746e8cc979527801893c92f19e6da assets/create/lang/unfinished/zh_cn.json 846200eb548d3bfa2e77b41039de159b4b6cfb45 assets/create/models/block/acacia_window.json 1930fa3a3c98d53dd19e4ee7f55bc27fd47aa281 assets/create/models/block/acacia_window_pane_noside.json 1763ea2c9b981d187f5031ba608f3d5d3be3986a assets/create/models/block/acacia_window_pane_noside_alt.json @@ -1396,6 +1397,7 @@ b0061419cf7b7bd2dd548ff00ee28f1227ee2663 assets/create/models/item/scoria_cobble da72ccdc893fbdd3efa9c22143b88eb756c20e44 assets/create/models/item/shadow_steel.json 081326d6666cfcfe34c45c1b74bfceba0b01ae6e assets/create/models/item/shadow_steel_casing.json 106ae694f7e03a218c37003dca8291b1d39b3c55 assets/create/models/item/shaft.json +188c49e5d8d9a2d5a570dbccdf3efd1b472dae18 assets/create/models/item/smart_fluid_pipe.json d6fb0d38b1b5bcc199b52ac8889eaecd167f6725 assets/create/models/item/speedometer.json b9abe1331d49871838231f3a8e5d2973634e9325 assets/create/models/item/spout.json b305e81f1dc5272634745b6e822af40955a2ef28 assets/create/models/item/spruce_window.json @@ -1562,6 +1564,7 @@ ccd49c33260333ba850d0b843c4913cb6371eee9 data/create/advancements/recipes/create ca21e2192a2fea0f112764f96c928d337762158b data/create/advancements/recipes/create.base/crafting/kinetics/pink_seat_from_other_seat.json 6c11444884679c4dd03d43f5893fca5cdc271915 data/create/advancements/recipes/create.base/crafting/kinetics/pink_valve_handle_from_other_valve_handle.json 960d03f13b383fca0d9b7d3a2885da346d97c4ef data/create/advancements/recipes/create.base/crafting/kinetics/piston_extension_pole.json +3190b3800152879614127c7cd2616e5607f1a0b1 data/create/advancements/recipes/create.base/crafting/kinetics/portable_storage_interface.json 02258b70f1db3d91f0ccb5a5ffd362349f8f359d data/create/advancements/recipes/create.base/crafting/kinetics/propeller.json d2a430820a87c24104729eede57628c6a92b277e data/create/advancements/recipes/create.base/crafting/kinetics/purple_seat.json 8eb1319984a8bf9502d8fddb717b11a1ee082f39 data/create/advancements/recipes/create.base/crafting/kinetics/purple_seat_from_other_seat.json @@ -1575,6 +1578,7 @@ dba0696069fe0850120dc6e1ca1ab741b0fe6d21 data/create/advancements/recipes/create b463cf9343f8d08b8ed3e87f46a19facadd657b0 data/create/advancements/recipes/create.base/crafting/kinetics/secondary_linear_chassisfrom_conversion.json 191213ef824e7b73d66bb3aecc3115306b445e5a data/create/advancements/recipes/create.base/crafting/kinetics/sequenced_gearshift.json cd8cefee21a1690f9158b8e8661a92d20ad0f535 data/create/advancements/recipes/create.base/crafting/kinetics/shaft.json +232044be44da655ff09deeb99cb220bf71e31096 data/create/advancements/recipes/create.base/crafting/kinetics/smart_fluid_pipe.json e8a5d924ccf30b6eae4b9ec0a8040e31f0eb165b data/create/advancements/recipes/create.base/crafting/kinetics/speedometer.json 90ff137eb1533695d9d17296ed180c0a88ddd891 data/create/advancements/recipes/create.base/crafting/kinetics/speedometerfrom_conversion.json 44867af16ec6d960268747effcd578ab55e3a366 data/create/advancements/recipes/create.base/crafting/kinetics/spout.json @@ -2385,6 +2389,7 @@ f70c5b7e7da7abffc82e3d1828499799883bbe85 data/create/loot_tables/blocks/secondar e4f6dccb8bce21b5214c1d8cfb440fc0ba4159d7 data/create/loot_tables/blocks/sequenced_gearshift.json 49f6b51c0618aa0c0133dc1f034ff6c031318cac data/create/loot_tables/blocks/shadow_steel_casing.json b127cb6920e6d7d9c8b2402cb186402a9a8dd3fc data/create/loot_tables/blocks/shaft.json +9e4d8220e513f5ecef27f60001681e9d66331d7b data/create/loot_tables/blocks/smart_fluid_pipe.json 70b6e82e9198d3910877e62c2eab86d46ca27089 data/create/loot_tables/blocks/speedometer.json f6c497d625de67ea9377e840208b1be539d13b73 data/create/loot_tables/blocks/spout.json a23a1e332c9ba84474e3c0588e8a0857afe346e0 data/create/loot_tables/blocks/spruce_window.json @@ -2540,6 +2545,7 @@ af871a02d363a619fff8e9dde753aa417b265a80 data/create/recipes/crafting/kinetics/p 840dc5aac716e3d1b79883e8db4bf56f2dc427f9 data/create/recipes/crafting/kinetics/pink_seat_from_other_seat.json 7e73bcde2b599f1ae5a241dd707c8ab6ce8c5a6e data/create/recipes/crafting/kinetics/pink_valve_handle_from_other_valve_handle.json 5399c3496a90bed9428c48fdd334ad4f763cbf9a data/create/recipes/crafting/kinetics/piston_extension_pole.json +0b09786f6d9823c6eddc91c3a6837377690dde49 data/create/recipes/crafting/kinetics/portable_storage_interface.json 16199a6729005a279854cb1838401f6e73bdebae data/create/recipes/crafting/kinetics/propeller.json 76ba751b65d312d1b34229d76fff2111b593091a data/create/recipes/crafting/kinetics/purple_seat.json e6c462d64e1de9c7fca95f9c9a25b8d1575979da data/create/recipes/crafting/kinetics/purple_seat_from_other_seat.json @@ -2553,6 +2559,7 @@ e9f1597d40f62c2247b319303f375f0da271346f data/create/recipes/crafting/kinetics/r 66922e18791c87fadb7629cdf32d3dd2f50ccd13 data/create/recipes/crafting/kinetics/secondary_linear_chassisfrom_conversion.json a17db27e61baa45f8a6ecb46a6d2a5a464704f8b data/create/recipes/crafting/kinetics/sequenced_gearshift.json 2e36438665bfb97265fd4e6ea85505970eae67fd data/create/recipes/crafting/kinetics/shaft.json +319e75dc4be645efd4809dafc1331581a8022e93 data/create/recipes/crafting/kinetics/smart_fluid_pipe.json b1a74f0b51fa37ca1ed814266b3d69b8b7e69fa3 data/create/recipes/crafting/kinetics/speedometer.json 8d632845deeb723e1a56083536ee5f9d60de2fcb data/create/recipes/crafting/kinetics/speedometerfrom_conversion.json eea9d4066cd2fafef40b50b79323dcc603fa6388 data/create/recipes/crafting/kinetics/spout.json diff --git a/src/generated/resources/assets/create/blockstates/fluid_pipe.json b/src/generated/resources/assets/create/blockstates/fluid_pipe.json index a4cffcde7..581373307 100644 --- a/src/generated/resources/assets/create/blockstates/fluid_pipe.json +++ b/src/generated/resources/assets/create/blockstates/fluid_pipe.json @@ -60,10 +60,10 @@ }, { "when": { - "down": "false", - "north": "true", + "south": "false", "up": "true", - "south": "false" + "down": "false", + "north": "true" }, "apply": { "model": "create:block/fluid_pipe/lu_x" @@ -71,10 +71,10 @@ }, { "when": { - "down": "false", - "north": "false", + "south": "true", "up": "true", - "south": "true" + "down": "false", + "north": "false" }, "apply": { "model": "create:block/fluid_pipe/ru_x" @@ -82,10 +82,10 @@ }, { "when": { - "down": "true", - "north": "true", + "south": "false", "up": "false", - "south": "false" + "down": "true", + "north": "true" }, "apply": { "model": "create:block/fluid_pipe/ld_x" @@ -93,10 +93,10 @@ }, { "when": { - "down": "true", - "north": "false", + "south": "true", "up": "false", - "south": "true" + "down": "true", + "north": "false" }, "apply": { "model": "create:block/fluid_pipe/rd_x" @@ -104,32 +104,10 @@ }, { "when": { - "down": "true", - "north": "false", + "south": "false", "up": "true", - "south": "false" - }, - "apply": { - "model": "create:block/fluid_pipe/ud_x" - } - }, - { - "when": { - "down": "false", - "north": "false", - "up": "true", - "south": "false" - }, - "apply": { - "model": "create:block/fluid_pipe/ud_x" - } - }, - { - "when": { "down": "true", - "north": "false", - "up": "false", - "south": "false" + "north": "false" }, "apply": { "model": "create:block/fluid_pipe/ud_x" @@ -137,10 +115,32 @@ }, { "when": { + "south": "false", + "up": "true", "down": "false", - "north": "true", + "north": "false" + }, + "apply": { + "model": "create:block/fluid_pipe/ud_x" + } + }, + { + "when": { + "south": "false", "up": "false", - "south": "true" + "down": "true", + "north": "false" + }, + "apply": { + "model": "create:block/fluid_pipe/ud_x" + } + }, + { + "when": { + "south": "true", + "up": "false", + "down": "false", + "north": "true" }, "apply": { "model": "create:block/fluid_pipe/lr_x" @@ -148,10 +148,10 @@ }, { "when": { - "down": "false", - "north": "true", + "south": "false", "up": "false", - "south": "false" + "down": "false", + "north": "true" }, "apply": { "model": "create:block/fluid_pipe/lr_x" @@ -159,10 +159,10 @@ }, { "when": { - "down": "false", - "north": "false", + "south": "true", "up": "false", - "south": "true" + "down": "false", + "north": "false" }, "apply": { "model": "create:block/fluid_pipe/lr_x" @@ -170,10 +170,10 @@ }, { "when": { - "down": "false", - "north": "false", + "south": "false", "up": "false", - "south": "false" + "down": "false", + "north": "false" }, "apply": { "model": "create:block/fluid_pipe/none_x" @@ -181,10 +181,10 @@ }, { "when": { + "south": "true", "west": "true", - "east": "false", "north": "false", - "south": "true" + "east": "false" }, "apply": { "model": "create:block/fluid_pipe/lu_y" @@ -192,10 +192,10 @@ }, { "when": { + "south": "true", "west": "false", - "east": "true", "north": "false", - "south": "true" + "east": "true" }, "apply": { "model": "create:block/fluid_pipe/ru_y" @@ -203,10 +203,10 @@ }, { "when": { + "south": "false", "west": "true", - "east": "false", "north": "true", - "south": "false" + "east": "false" }, "apply": { "model": "create:block/fluid_pipe/ld_y" @@ -214,10 +214,10 @@ }, { "when": { + "south": "false", "west": "false", - "east": "true", "north": "true", - "south": "false" + "east": "true" }, "apply": { "model": "create:block/fluid_pipe/rd_y" @@ -225,10 +225,10 @@ }, { "when": { + "south": "true", "west": "false", - "east": "false", "north": "true", - "south": "true" + "east": "false" }, "apply": { "model": "create:block/fluid_pipe/ud_y" @@ -236,10 +236,10 @@ }, { "when": { + "south": "true", "west": "false", - "east": "false", "north": "false", - "south": "true" + "east": "false" }, "apply": { "model": "create:block/fluid_pipe/ud_y" @@ -247,10 +247,10 @@ }, { "when": { + "south": "false", "west": "false", - "east": "false", "north": "true", - "south": "false" + "east": "false" }, "apply": { "model": "create:block/fluid_pipe/ud_y" @@ -258,10 +258,10 @@ }, { "when": { + "south": "false", "west": "true", - "east": "true", "north": "false", - "south": "false" + "east": "true" }, "apply": { "model": "create:block/fluid_pipe/lr_y" @@ -269,10 +269,10 @@ }, { "when": { + "south": "false", "west": "true", - "east": "false", "north": "false", - "south": "false" + "east": "false" }, "apply": { "model": "create:block/fluid_pipe/lr_y" @@ -280,10 +280,10 @@ }, { "when": { + "south": "false", "west": "false", - "east": "true", "north": "false", - "south": "false" + "east": "true" }, "apply": { "model": "create:block/fluid_pipe/lr_y" @@ -291,10 +291,10 @@ }, { "when": { + "south": "false", "west": "false", - "east": "false", "north": "false", - "south": "false" + "east": "false" }, "apply": { "model": "create:block/fluid_pipe/none_y" @@ -302,10 +302,10 @@ }, { "when": { - "west": "false", + "up": "true", "down": "false", - "east": "true", - "up": "true" + "west": "false", + "east": "true" }, "apply": { "model": "create:block/fluid_pipe/lu_z" @@ -313,10 +313,10 @@ }, { "when": { - "west": "true", + "up": "true", "down": "false", - "east": "false", - "up": "true" + "west": "true", + "east": "false" }, "apply": { "model": "create:block/fluid_pipe/ru_z" @@ -324,10 +324,10 @@ }, { "when": { - "west": "false", + "up": "false", "down": "true", - "east": "true", - "up": "false" + "west": "false", + "east": "true" }, "apply": { "model": "create:block/fluid_pipe/ld_z" @@ -335,10 +335,10 @@ }, { "when": { - "west": "true", + "up": "false", "down": "true", - "east": "false", - "up": "false" + "west": "true", + "east": "false" }, "apply": { "model": "create:block/fluid_pipe/rd_z" @@ -346,10 +346,10 @@ }, { "when": { - "west": "false", + "up": "true", "down": "true", - "east": "false", - "up": "true" + "west": "false", + "east": "false" }, "apply": { "model": "create:block/fluid_pipe/ud_z" @@ -357,10 +357,10 @@ }, { "when": { - "west": "false", + "up": "true", "down": "false", - "east": "false", - "up": "true" + "west": "false", + "east": "false" }, "apply": { "model": "create:block/fluid_pipe/ud_z" @@ -368,10 +368,10 @@ }, { "when": { - "west": "false", + "up": "false", "down": "true", - "east": "false", - "up": "false" + "west": "false", + "east": "false" }, "apply": { "model": "create:block/fluid_pipe/ud_z" @@ -379,10 +379,10 @@ }, { "when": { + "up": "false", + "down": "false", "west": "true", - "down": "false", - "east": "true", - "up": "false" + "east": "true" }, "apply": { "model": "create:block/fluid_pipe/lr_z" @@ -390,10 +390,10 @@ }, { "when": { + "up": "false", + "down": "false", "west": "false", - "down": "false", - "east": "true", - "up": "false" + "east": "true" }, "apply": { "model": "create:block/fluid_pipe/lr_z" @@ -401,10 +401,10 @@ }, { "when": { + "up": "false", + "down": "false", "west": "true", - "down": "false", - "east": "false", - "up": "false" + "east": "false" }, "apply": { "model": "create:block/fluid_pipe/lr_z" @@ -412,10 +412,10 @@ }, { "when": { - "west": "false", + "up": "false", "down": "false", - "east": "false", - "up": "false" + "west": "false", + "east": "false" }, "apply": { "model": "create:block/fluid_pipe/none_z" diff --git a/src/generated/resources/assets/create/blockstates/smart_fluid_pipe.json b/src/generated/resources/assets/create/blockstates/smart_fluid_pipe.json new file mode 100644 index 000000000..cf7adfc36 --- /dev/null +++ b/src/generated/resources/assets/create/blockstates/smart_fluid_pipe.json @@ -0,0 +1,57 @@ +{ + "variants": { + "face=floor,facing=north": { + "model": "create:block/smart_fluid_pipe/block", + "y": 180 + }, + "face=wall,facing=north": { + "model": "create:block/smart_fluid_pipe/block", + "x": 270, + "y": 180 + }, + "face=ceiling,facing=north": { + "model": "create:block/smart_fluid_pipe/block", + "x": 180 + }, + "face=floor,facing=south": { + "model": "create:block/smart_fluid_pipe/block" + }, + "face=wall,facing=south": { + "model": "create:block/smart_fluid_pipe/block", + "x": 270 + }, + "face=ceiling,facing=south": { + "model": "create:block/smart_fluid_pipe/block", + "x": 180, + "y": 180 + }, + "face=floor,facing=west": { + "model": "create:block/smart_fluid_pipe/block", + "y": 90 + }, + "face=wall,facing=west": { + "model": "create:block/smart_fluid_pipe/block", + "x": 270, + "y": 90 + }, + "face=ceiling,facing=west": { + "model": "create:block/smart_fluid_pipe/block", + "x": 180, + "y": 270 + }, + "face=floor,facing=east": { + "model": "create:block/smart_fluid_pipe/block", + "y": 270 + }, + "face=wall,facing=east": { + "model": "create:block/smart_fluid_pipe/block", + "x": 270, + "y": 270 + }, + "face=ceiling,facing=east": { + "model": "create:block/smart_fluid_pipe/block", + "x": 180, + "y": 90 + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/lang/en_ud.json b/src/generated/resources/assets/create/lang/en_ud.json index 7a9f23c32..49e40242a 100644 --- a/src/generated/resources/assets/create/lang/en_ud.json +++ b/src/generated/resources/assets/create/lang/en_ud.json @@ -339,6 +339,7 @@ "block.create.sequenced_gearshift": "\u0287\u025F\u0131\u0265s\u0279\u0250\u01DD\u2141 p\u01DD\u0254u\u01DDnb\u01DDS", "block.create.shadow_steel_casing": "bu\u0131s\u0250\u0186 \u028Dop\u0250\u0265S", "block.create.shaft": "\u0287\u025F\u0250\u0265S", + "block.create.smart_fluid_pipe": "\u01DDd\u0131\u0500 p\u0131n\u05DF\u2132 \u0287\u0279\u0250\u026FS", "block.create.speedometer": "\u0279\u01DD\u0287\u01DD\u026Fop\u01DD\u01DDdS", "block.create.spout": "\u0287nodS", "block.create.spruce_window": "\u028Dopu\u0131M \u01DD\u0254n\u0279dS", diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index 622a30a18..a178af162 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -342,6 +342,7 @@ "block.create.sequenced_gearshift": "Sequenced Gearshift", "block.create.shadow_steel_casing": "Shadow Casing", "block.create.shaft": "Shaft", + "block.create.smart_fluid_pipe": "Smart Fluid Pipe", "block.create.speedometer": "Speedometer", "block.create.spout": "Spout", "block.create.spruce_window": "Spruce Window", @@ -674,6 +675,7 @@ "create.logistics.filter": "Filter", "create.logistics.recipe_filter": "Recipe Filter", + "create.logistics.fluid_filter": "Fluid Filter", "create.logistics.firstFrequency": "Freq. #1", "create.logistics.secondFrequency": "Freq. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/de_de.json b/src/generated/resources/assets/create/lang/unfinished/de_de.json index 4c1a02534..4f0561656 100644 --- a/src/generated/resources/assets/create/lang/unfinished/de_de.json +++ b/src/generated/resources/assets/create/lang/unfinished/de_de.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 920", + "_": "Missing Localizations: 922", "_": "->------------------------] Game Elements [------------------------<-", @@ -343,6 +343,7 @@ "block.create.sequenced_gearshift": "UNLOCALIZED: Sequenced Gearshift", "block.create.shadow_steel_casing": "UNLOCALIZED: Shadow Casing", "block.create.shaft": "Welle", + "block.create.smart_fluid_pipe": "UNLOCALIZED: Smart Fluid Pipe", "block.create.speedometer": "UNLOCALIZED: Speedometer", "block.create.spout": "UNLOCALIZED: Spout", "block.create.spruce_window": "UNLOCALIZED: Spruce Window", @@ -675,6 +676,7 @@ "create.logistics.filter": "Filter", "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", + "create.logistics.fluid_filter": "UNLOCALIZED: Fluid Filter", "create.logistics.firstFrequency": "Freq. #1", "create.logistics.secondFrequency": "Freq. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json index a1f01ad5d..cb26a7b57 100644 --- a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json +++ b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 545", + "_": "Missing Localizations: 547", "_": "->------------------------] Game Elements [------------------------<-", @@ -343,6 +343,7 @@ "block.create.sequenced_gearshift": "Décaleur de rotation séquencé", "block.create.shadow_steel_casing": "UNLOCALIZED: Shadow Casing", "block.create.shaft": "Arbre mécanique", + "block.create.smart_fluid_pipe": "UNLOCALIZED: Smart Fluid Pipe", "block.create.speedometer": "Compteur de vitesse", "block.create.spout": "UNLOCALIZED: Spout", "block.create.spruce_window": "UNLOCALIZED: Spruce Window", @@ -675,6 +676,7 @@ "create.logistics.filter": "Filtre", "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", + "create.logistics.fluid_filter": "UNLOCALIZED: Fluid Filter", "create.logistics.firstFrequency": "Freq. #1", "create.logistics.secondFrequency": "Freq. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/it_it.json b/src/generated/resources/assets/create/lang/unfinished/it_it.json index d08c73d2e..9efa7360c 100644 --- a/src/generated/resources/assets/create/lang/unfinished/it_it.json +++ b/src/generated/resources/assets/create/lang/unfinished/it_it.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 533", + "_": "Missing Localizations: 535", "_": "->------------------------] Game Elements [------------------------<-", @@ -343,6 +343,7 @@ "block.create.sequenced_gearshift": "Cambio Sequenziale", "block.create.shadow_steel_casing": "UNLOCALIZED: Shadow Casing", "block.create.shaft": "Albero", + "block.create.smart_fluid_pipe": "UNLOCALIZED: Smart Fluid Pipe", "block.create.speedometer": "Tachimetro", "block.create.spout": "UNLOCALIZED: Spout", "block.create.spruce_window": "UNLOCALIZED: Spruce Window", @@ -675,6 +676,7 @@ "create.logistics.filter": "Filtro", "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", + "create.logistics.fluid_filter": "UNLOCALIZED: Fluid Filter", "create.logistics.firstFrequency": "Freq. #1", "create.logistics.secondFrequency": "Freq. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json index 3bf076f8e..f0976e969 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json +++ b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 528", + "_": "Missing Localizations: 530", "_": "->------------------------] Game Elements [------------------------<-", @@ -343,6 +343,7 @@ "block.create.sequenced_gearshift": "シーケンスギアシフト", "block.create.shadow_steel_casing": "UNLOCALIZED: Shadow Casing", "block.create.shaft": "軸", + "block.create.smart_fluid_pipe": "UNLOCALIZED: Smart Fluid Pipe", "block.create.speedometer": "スピードメーター", "block.create.spout": "UNLOCALIZED: Spout", "block.create.spruce_window": "UNLOCALIZED: Spruce Window", @@ -675,6 +676,7 @@ "create.logistics.filter": "フィルタ", "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", + "create.logistics.fluid_filter": "UNLOCALIZED: Fluid Filter", "create.logistics.firstFrequency": "Freq. #1", "create.logistics.secondFrequency": "Freq. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json index e4d28985c..887eb9a0e 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json +++ b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 533", + "_": "Missing Localizations: 535", "_": "->------------------------] Game Elements [------------------------<-", @@ -343,6 +343,7 @@ "block.create.sequenced_gearshift": "순서 기어쉬프트", "block.create.shadow_steel_casing": "UNLOCALIZED: Shadow Casing", "block.create.shaft": "축", + "block.create.smart_fluid_pipe": "UNLOCALIZED: Smart Fluid Pipe", "block.create.speedometer": "속도 계측기", "block.create.spout": "UNLOCALIZED: Spout", "block.create.spruce_window": "UNLOCALIZED: Spruce Window", @@ -675,6 +676,7 @@ "create.logistics.filter": "필터", "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", + "create.logistics.fluid_filter": "UNLOCALIZED: Fluid Filter", "create.logistics.firstFrequency": "주파수. #1", "create.logistics.secondFrequency": "주파수. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json index b8ce77f30..87943968c 100644 --- a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json +++ b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 859", + "_": "Missing Localizations: 861", "_": "->------------------------] Game Elements [------------------------<-", @@ -343,6 +343,7 @@ "block.create.sequenced_gearshift": "UNLOCALIZED: Sequenced Gearshift", "block.create.shadow_steel_casing": "UNLOCALIZED: Shadow Casing", "block.create.shaft": "Drijfas", + "block.create.smart_fluid_pipe": "UNLOCALIZED: Smart Fluid Pipe", "block.create.speedometer": "Snelheidsmeter", "block.create.spout": "UNLOCALIZED: Spout", "block.create.spruce_window": "UNLOCALIZED: Spruce Window", @@ -675,6 +676,7 @@ "create.logistics.filter": "Filter", "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", + "create.logistics.fluid_filter": "UNLOCALIZED: Fluid Filter", "create.logistics.firstFrequency": "Freq. #1", "create.logistics.secondFrequency": "Freq. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/pt_br.json b/src/generated/resources/assets/create/lang/unfinished/pt_br.json index 609f87712..be9d0d07d 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pt_br.json +++ b/src/generated/resources/assets/create/lang/unfinished/pt_br.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 927", + "_": "Missing Localizations: 929", "_": "->------------------------] Game Elements [------------------------<-", @@ -343,6 +343,7 @@ "block.create.sequenced_gearshift": "UNLOCALIZED: Sequenced Gearshift", "block.create.shadow_steel_casing": "UNLOCALIZED: Shadow Casing", "block.create.shaft": "Eixo", + "block.create.smart_fluid_pipe": "UNLOCALIZED: Smart Fluid Pipe", "block.create.speedometer": "UNLOCALIZED: Speedometer", "block.create.spout": "UNLOCALIZED: Spout", "block.create.spruce_window": "UNLOCALIZED: Spruce Window", @@ -675,6 +676,7 @@ "create.logistics.filter": "Filtros", "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", + "create.logistics.fluid_filter": "UNLOCALIZED: Fluid Filter", "create.logistics.firstFrequency": "UNLOCALIZED: Freq. #1", "create.logistics.secondFrequency": "UNLOCALIZED: Freq. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json index fa50db719..c9e93e431 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json +++ b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 921", + "_": "Missing Localizations: 923", "_": "->------------------------] Game Elements [------------------------<-", @@ -343,6 +343,7 @@ "block.create.sequenced_gearshift": "UNLOCALIZED: Sequenced Gearshift", "block.create.shadow_steel_casing": "UNLOCALIZED: Shadow Casing", "block.create.shaft": "Вал", + "block.create.smart_fluid_pipe": "UNLOCALIZED: Smart Fluid Pipe", "block.create.speedometer": "UNLOCALIZED: Speedometer", "block.create.spout": "UNLOCALIZED: Spout", "block.create.spruce_window": "UNLOCALIZED: Spruce Window", @@ -675,6 +676,7 @@ "create.logistics.filter": "Фильтр", "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", + "create.logistics.fluid_filter": "UNLOCALIZED: Fluid Filter", "create.logistics.firstFrequency": "Част. #1", "create.logistics.secondFrequency": "Част. #2", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json index ef32d87f1..abc133ef5 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 215", + "_": "Missing Localizations: 217", "_": "->------------------------] Game Elements [------------------------<-", @@ -343,6 +343,7 @@ "block.create.sequenced_gearshift": "可编程齿轮箱", "block.create.shadow_steel_casing": "UNLOCALIZED: Shadow Casing", "block.create.shaft": "传动杆", + "block.create.smart_fluid_pipe": "UNLOCALIZED: Smart Fluid Pipe", "block.create.speedometer": "速度表", "block.create.spout": "UNLOCALIZED: Spout", "block.create.spruce_window": "云杉窗户", @@ -675,6 +676,7 @@ "create.logistics.filter": "过滤器", "create.logistics.recipe_filter": "UNLOCALIZED: Recipe Filter", + "create.logistics.fluid_filter": "UNLOCALIZED: Fluid Filter", "create.logistics.firstFrequency": "频道. #1", "create.logistics.secondFrequency": "频道. #2", diff --git a/src/generated/resources/assets/create/models/item/smart_fluid_pipe.json b/src/generated/resources/assets/create/models/item/smart_fluid_pipe.json new file mode 100644 index 000000000..1c516bf89 --- /dev/null +++ b/src/generated/resources/assets/create/models/item/smart_fluid_pipe.json @@ -0,0 +1,3 @@ +{ + "parent": "create:block/smart_fluid_pipe/item" +} \ No newline at end of file diff --git a/src/generated/resources/data/create/advancements/recipes/create.base/crafting/kinetics/portable_storage_interface.json b/src/generated/resources/data/create/advancements/recipes/create.base/crafting/kinetics/portable_storage_interface.json new file mode 100644 index 000000000..b2f967f18 --- /dev/null +++ b/src/generated/resources/data/create/advancements/recipes/create.base/crafting/kinetics/portable_storage_interface.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "create:crafting/kinetics/portable_storage_interface" + ] + }, + "criteria": { + "has_item": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:brass_casing" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "create:crafting/kinetics/portable_storage_interface" + } + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/advancements/recipes/create.base/crafting/kinetics/smart_fluid_pipe.json b/src/generated/resources/data/create/advancements/recipes/create.base/crafting/kinetics/smart_fluid_pipe.json new file mode 100644 index 000000000..a1ade7524 --- /dev/null +++ b/src/generated/resources/data/create/advancements/recipes/create.base/crafting/kinetics/smart_fluid_pipe.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "create:crafting/kinetics/smart_fluid_pipe" + ] + }, + "criteria": { + "has_item": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "forge:ingots/copper" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "create:crafting/kinetics/smart_fluid_pipe" + } + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/loot_tables/blocks/smart_fluid_pipe.json b/src/generated/resources/data/create/loot_tables/blocks/smart_fluid_pipe.json new file mode 100644 index 000000000..3f18d0b41 --- /dev/null +++ b/src/generated/resources/data/create/loot_tables/blocks/smart_fluid_pipe.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "create:smart_fluid_pipe" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/recipes/crafting/kinetics/portable_storage_interface.json b/src/generated/resources/data/create/recipes/crafting/kinetics/portable_storage_interface.json new file mode 100644 index 000000000..87f103a47 --- /dev/null +++ b/src/generated/resources/data/create/recipes/crafting/kinetics/portable_storage_interface.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " B ", + " I " + ], + "key": { + "I": { + "item": "create:redstone_contact" + }, + "B": { + "item": "create:andesite_funnel" + } + }, + "result": { + "item": "create:portable_storage_interface" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/create/recipes/crafting/kinetics/smart_fluid_pipe.json b/src/generated/resources/data/create/recipes/crafting/kinetics/smart_fluid_pipe.json new file mode 100644 index 000000000..7dc68a5a7 --- /dev/null +++ b/src/generated/resources/data/create/recipes/crafting/kinetics/smart_fluid_pipe.json @@ -0,0 +1,22 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "I", + "S", + "P" + ], + "key": { + "P": { + "item": "create:electron_tube" + }, + "S": { + "item": "create:fluid_pipe" + }, + "I": { + "tag": "forge:plates/brass" + } + }, + "result": { + "item": "create:smart_fluid_pipe" + } +} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index 9076047f9..90af7a5ee 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -68,6 +68,8 @@ import com.simibubi.create.content.contraptions.fluids.pipes.EncasedPipeBlock; import com.simibubi.create.content.contraptions.fluids.pipes.FluidPipeBlock; import com.simibubi.create.content.contraptions.fluids.pipes.FluidValveBlock; import com.simibubi.create.content.contraptions.fluids.pipes.GlassFluidPipeBlock; +import com.simibubi.create.content.contraptions.fluids.pipes.SmartFluidPipeBlock; +import com.simibubi.create.content.contraptions.fluids.pipes.SmartFluidPipeGenerator; import com.simibubi.create.content.contraptions.fluids.tank.FluidTankBlock; import com.simibubi.create.content.contraptions.fluids.tank.FluidTankGenerator; import com.simibubi.create.content.contraptions.fluids.tank.FluidTankItem; @@ -500,6 +502,15 @@ public class AllBlocks { .transform(customItemModel()) .register(); + public static final BlockEntry SMART_FLUID_PIPE = + REGISTRATE.block("smart_fluid_pipe", SmartFluidPipeBlock::new) + .initialProperties(SharedProperties::softMetal) + .blockstate(new SmartFluidPipeGenerator()::generate) + .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::new)) + .item() + .transform(customItemModel()) + .register(); + public static final BlockEntry FLUID_VALVE = REGISTRATE.block("fluid_valve", FluidValveBlock::new) .initialProperties(SharedProperties::softMetal) .blockstate((c, p) -> BlockStateGen.directionalAxisBlock(c, p, diff --git a/src/main/java/com/simibubi/create/AllShapes.java b/src/main/java/com/simibubi/create/AllShapes.java index dbf65f2b4..d17538bfb 100644 --- a/src/main/java/com/simibubi/create/AllShapes.java +++ b/src/main/java/com/simibubi/create/AllShapes.java @@ -80,6 +80,24 @@ public class AllShapes { .forHorizontal(NORTH), FLUID_VALVE = shape(3, -1, 3, 13, 17, 13).add(2, 2, 2, 14, 14, 14) .forAxis(), + SMART_FLUID_PIPE_FLOOR = shape(4, 4, 0, 12, 12, 16).add(3, 3, 3, 13, 13, 13) + .add(5, 13, 3, 11, 14, 11) + .add(5, 14, 4, 11, 15, 10) + .add(5, 15, 5, 11, 16, 9) + .add(5, 16, 6, 11, 17, 8) + .forHorizontal(Direction.SOUTH), + SMART_FLUID_PIPE_WALL = shape(4, 0, 4, 12, 16, 12).add(3, 3, 3, 13, 13, 13) + .add(5, 5, 13, 11, 13, 14) + .add(5, 6, 14, 11, 12, 15) + .add(5, 7, 15, 11, 11, 16) + .add(5, 8, 16, 11, 10, 17) + .forHorizontal(Direction.SOUTH), + SMART_FLUID_PIPE_CEILING = shape(4, 4, 0, 12, 12, 16).add(3, 3, 3, 13, 13, 13) + .add(5, 3, 3, 11, 2, 11) + .add(5, 2, 4, 11, 1, 10) + .add(5, 1, 5, 11, 0, 9) + .add(5, 0, 6, 11, -1, 8) + .forHorizontal(Direction.SOUTH), PUMP = shape(2, 0, 2, 14, 5, 14).add(4, 0, 4, 12, 16, 12) .add(3, 12, 3, 13, 16, 13) .forDirectional(Direction.UP) diff --git a/src/main/java/com/simibubi/create/AllTileEntities.java b/src/main/java/com/simibubi/create/AllTileEntities.java index e352bbad6..6471eec40 100644 --- a/src/main/java/com/simibubi/create/AllTileEntities.java +++ b/src/main/java/com/simibubi/create/AllTileEntities.java @@ -52,6 +52,7 @@ import com.simibubi.create.content.contraptions.fluids.actors.SpoutTileEntity; import com.simibubi.create.content.contraptions.fluids.pipes.FluidPipeTileEntity; import com.simibubi.create.content.contraptions.fluids.pipes.FluidValveRenderer; import com.simibubi.create.content.contraptions.fluids.pipes.FluidValveTileEntity; +import com.simibubi.create.content.contraptions.fluids.pipes.SmartFluidPipeTileEntity; import com.simibubi.create.content.contraptions.fluids.pipes.StraightPipeTileEntity; import com.simibubi.create.content.contraptions.fluids.pipes.TransparentStraightPipeRenderer; import com.simibubi.create.content.contraptions.fluids.tank.FluidTankRenderer; @@ -200,6 +201,12 @@ public class AllTileEntities { .validBlocks(AllBlocks.MECHANICAL_PUMP) .renderer(() -> PumpRenderer::new) .register(); + + public static final TileEntityEntry SMART_FLUID_PIPE = Create.registrate() + .tileEntity("smart_fluid_pipe", SmartFluidPipeTileEntity::new) + .validBlocks(AllBlocks.SMART_FLUID_PIPE) + .renderer(() -> SmartTileEntityRenderer::new) + .register(); public static final TileEntityEntry FLUID_PIPE = Create.registrate() .tileEntity("fluid_pipe", FluidPipeTileEntity::new) diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/AxisPipeBlock.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/AxisPipeBlock.java index 71a17ee4f..885ebabc0 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/AxisPipeBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/AxisPipeBlock.java @@ -16,6 +16,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.network.DebugPacketSender; import net.minecraft.state.BooleanProperty; import net.minecraft.util.Direction; +import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; @@ -27,7 +28,7 @@ import net.minecraft.world.TickPriority; import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; -public class AxisPipeBlock extends RotatedPillarBlock implements IWrenchable { +public class AxisPipeBlock extends RotatedPillarBlock implements IWrenchable, IAxisPipe { public AxisPipeBlock(Properties p_i48339_1_) { super(p_i48339_1_); @@ -94,4 +95,9 @@ public class AxisPipeBlock extends RotatedPillarBlock implements IWrenchable { .with(facingToPropertyMap.get(side.getOpposite()), true), side, null, world, pos); } + @Override + public Axis getAxis(BlockState state) { + return state.get(AXIS); + } + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/FluidValveBlock.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/FluidValveBlock.java index c56476060..4b30fa022 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/FluidValveBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/FluidValveBlock.java @@ -18,7 +18,7 @@ import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorldReader; -public class FluidValveBlock extends DirectionalAxisKineticBlock { +public class FluidValveBlock extends DirectionalAxisKineticBlock implements IAxisPipe { public static final BooleanProperty ENABLED = BooleanProperty.create("enabled"); @@ -70,4 +70,9 @@ public class FluidValveBlock extends DirectionalAxisKineticBlock { return null; } + @Override + public Axis getAxis(BlockState state) { + return getPipeAxis(state); + } + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/FluidValveTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/FluidValveTileEntity.java index b3d3efc27..1eb5a71b6 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/FluidValveTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/FluidValveTileEntity.java @@ -2,10 +2,9 @@ package com.simibubi.create.content.contraptions.fluids.pipes; import java.util.List; -import com.simibubi.create.AllBlocks; import com.simibubi.create.content.contraptions.base.KineticTileEntity; -import com.simibubi.create.content.contraptions.fluids.FluidPipeAttachmentBehaviour; import com.simibubi.create.content.contraptions.fluids.FluidPipeBehaviour; +import com.simibubi.create.content.contraptions.fluids.pipes.StraightPipeTileEntity.StraightPipeAttachmentBehaviour; import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.utility.LerpedFloat; @@ -15,10 +14,7 @@ import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; -import net.minecraft.util.Direction.AxisDirection; -import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.world.ILightReader; import net.minecraftforge.fluids.FluidStack; public class FluidValveTileEntity extends KineticTileEntity { @@ -81,7 +77,7 @@ public class FluidValveTileEntity extends KineticTileEntity { @Override public void addBehaviours(List behaviours) { behaviours.add(new ValvePipeBehaviour(this)); - behaviours.add(new ValvePipeAttachmentBehaviour(this)); + behaviours.add(new StraightPipeAttachmentBehaviour(this)); } class ValvePipeBehaviour extends FluidPipeBehaviour { @@ -104,25 +100,4 @@ public class FluidValveTileEntity extends KineticTileEntity { } - class ValvePipeAttachmentBehaviour extends FluidPipeAttachmentBehaviour { - - public ValvePipeAttachmentBehaviour(SmartTileEntity te) { - super(te); - } - - @Override - public AttachmentTypes getAttachment(ILightReader world, BlockPos pos, BlockState state, Direction direction) { - AttachmentTypes attachment = super.getAttachment(world, pos, state, direction); - - BlockState facingState = world.getBlockState(pos.offset(direction)); - if (AllBlocks.FLUID_VALVE.has(facingState) - && FluidValveBlock.getPipeAxis(facingState) == FluidValveBlock.getPipeAxis(state) - && direction.getAxisDirection() == AxisDirection.NEGATIVE) - return AttachmentTypes.NONE; - - return attachment; - } - - } - } diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/IAxisPipe.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/IAxisPipe.java new file mode 100644 index 000000000..2d5242a03 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/IAxisPipe.java @@ -0,0 +1,19 @@ +package com.simibubi.create.content.contraptions.fluids.pipes; + +import javax.annotation.Nullable; + +import net.minecraft.block.BlockState; +import net.minecraft.util.Direction.Axis; + +public interface IAxisPipe { + + @Nullable + public static Axis getAxisOf(BlockState state) { + if (state.getBlock() instanceof IAxisPipe) + return ((IAxisPipe) state.getBlock()).getAxis(state); + return null; + } + + public Axis getAxis(BlockState state); + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/SmartFluidPipeBlock.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/SmartFluidPipeBlock.java new file mode 100644 index 000000000..de3964bc9 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/SmartFluidPipeBlock.java @@ -0,0 +1,156 @@ +package com.simibubi.create.content.contraptions.fluids.pipes; + +import java.util.Random; + +import com.simibubi.create.AllShapes; +import com.simibubi.create.AllTileEntities; +import com.simibubi.create.content.contraptions.fluids.FluidPropagator; +import com.simibubi.create.foundation.utility.Iterate; +import com.simibubi.create.foundation.utility.VoxelShaper; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.HorizontalFaceBlock; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.network.DebugPacketSender; +import net.minecraft.state.StateContainer.Builder; +import net.minecraft.state.properties.AttachFace; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Direction; +import net.minecraft.util.Direction.Axis; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.IWorldReader; +import net.minecraft.world.TickPriority; +import net.minecraft.world.World; +import net.minecraft.world.server.ServerWorld; + +public class SmartFluidPipeBlock extends HorizontalFaceBlock implements IAxisPipe { + + public SmartFluidPipeBlock(Properties p_i48339_1_) { + super(p_i48339_1_); + } + + @Override + protected void fillStateContainer(Builder builder) { + builder.add(FACE) + .add(HORIZONTAL_FACING); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext ctx) { + BlockState stateForPlacement = super.getStateForPlacement(ctx); + Axis prefferedAxis = null; + BlockPos pos = ctx.getPos(); + World world = ctx.getWorld(); + for (Direction side : Iterate.directions) { + if (!prefersConnectionTo(world, pos, side)) + continue; + if (prefferedAxis != null && prefferedAxis != side.getAxis()) { + prefferedAxis = null; + break; + } + prefferedAxis = side.getAxis(); + } + + if (prefferedAxis == Axis.Y) + stateForPlacement = stateForPlacement.with(FACE, AttachFace.WALL) + .with(HORIZONTAL_FACING, stateForPlacement.get(HORIZONTAL_FACING) + .getOpposite()); + else if (prefferedAxis != null) { + if (stateForPlacement.get(FACE) == AttachFace.WALL) + stateForPlacement = stateForPlacement.with(FACE, AttachFace.FLOOR); + for (Direction direction : ctx.getNearestLookingDirections()) { + if (direction.getAxis() != prefferedAxis) + continue; + stateForPlacement = stateForPlacement.with(HORIZONTAL_FACING, direction.getOpposite()); + } + } + + return stateForPlacement; + } + + protected boolean prefersConnectionTo(IWorldReader reader, BlockPos pos, Direction facing) { + BlockPos offset = pos.offset(facing); + BlockState blockState = reader.getBlockState(offset); + return FluidPipeBlock.canConnectTo(reader, offset, blockState, facing); + } + + @Override + public void onReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean isMoving) { + boolean blockTypeChanged = state.getBlock() != newState.getBlock(); + if (blockTypeChanged && !world.isRemote) + FluidPropagator.propagateChangedPipe(world, pos, state); + if (state.hasTileEntity() && (blockTypeChanged || !newState.hasTileEntity())) + world.removeTileEntity(pos); + } + + @Override + public boolean isValidPosition(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_) { + return true; + } + + @Override + public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean isMoving) { + if (world.isRemote) + return; + if (state != oldState) + world.getPendingBlockTicks() + .scheduleTick(pos, this, 1, TickPriority.HIGH); + } + + @Override + public void neighborChanged(BlockState state, World world, BlockPos pos, Block otherBlock, BlockPos neighborPos, + boolean isMoving) { + DebugPacketSender.func_218806_a(world, pos); + Direction d = FluidPropagator.validateNeighbourChange(state, world, pos, otherBlock, neighborPos, isMoving); + if (d == null) + return; + if (!isOpenAt(state, d)) + return; + world.getPendingBlockTicks() + .scheduleTick(pos, this, 1, TickPriority.HIGH); + } + + public static boolean isOpenAt(BlockState state, Direction d) { + return d.getAxis() == getPipeAxis(state); + } + + protected static Axis getPipeAxis(BlockState state) { + return state.get(FACE) == AttachFace.WALL ? Axis.Y + : state.get(HORIZONTAL_FACING) + .getAxis(); + } + + @Override + public boolean hasTileEntity(BlockState state) { + return true; + } + + @Override + public TileEntity createTileEntity(BlockState state, IBlockReader world) { + return AllTileEntities.SMART_FLUID_PIPE.create(); + } + + @Override + public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random r) { + FluidPropagator.propagateChangedPipe(world, pos, state); + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader p_220053_2_, BlockPos p_220053_3_, + ISelectionContext p_220053_4_) { + AttachFace face = state.get(FACE); + VoxelShaper shape = face == AttachFace.FLOOR ? AllShapes.SMART_FLUID_PIPE_FLOOR + : face == AttachFace.CEILING ? AllShapes.SMART_FLUID_PIPE_CEILING : AllShapes.SMART_FLUID_PIPE_WALL; + return shape.get(state.get(HORIZONTAL_FACING)); + } + + @Override + public Axis getAxis(BlockState state) { + return getPipeAxis(state); + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/SmartFluidPipeGenerator.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/SmartFluidPipeGenerator.java new file mode 100644 index 000000000..0b2467ab0 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/SmartFluidPipeGenerator.java @@ -0,0 +1,34 @@ +package com.simibubi.create.content.contraptions.fluids.pipes; + +import com.simibubi.create.foundation.data.AssetLookup; +import com.simibubi.create.foundation.data.SpecialBlockStateGen; +import com.tterrag.registrate.providers.DataGenContext; +import com.tterrag.registrate.providers.RegistrateBlockstateProvider; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.state.properties.AttachFace; +import net.minecraftforge.client.model.generators.ModelFile; + +public class SmartFluidPipeGenerator extends SpecialBlockStateGen { + + @Override + protected int getXRotation(BlockState state) { + AttachFace attachFace = state.get(SmartFluidPipeBlock.FACE); + return attachFace == AttachFace.CEILING ? 180 : attachFace == AttachFace.FLOOR ? 0 : 270; + } + + @Override + protected int getYRotation(BlockState state) { + AttachFace attachFace = state.get(SmartFluidPipeBlock.FACE); + int angle = horizontalAngle(state.get(SmartFluidPipeBlock.HORIZONTAL_FACING)); + return angle + (attachFace == AttachFace.CEILING ? 180 : 0); + } + + @Override + public ModelFile getModel(DataGenContext ctx, RegistrateBlockstateProvider prov, + BlockState state) { + return AssetLookup.partialBaseModel(ctx, prov); + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/SmartFluidPipeTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/SmartFluidPipeTileEntity.java new file mode 100644 index 000000000..9b5378b88 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/SmartFluidPipeTileEntity.java @@ -0,0 +1,97 @@ +package com.simibubi.create.content.contraptions.fluids.pipes; + +import java.util.List; + +import com.mojang.blaze3d.matrix.MatrixStack; +import com.simibubi.create.content.contraptions.fluids.FluidPipeBehaviour; +import com.simibubi.create.content.contraptions.fluids.FluidPropagator; +import com.simibubi.create.content.contraptions.fluids.pipes.StraightPipeTileEntity.StraightPipeAttachmentBehaviour; +import com.simibubi.create.foundation.tileEntity.SmartTileEntity; +import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; +import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform; +import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour; +import com.simibubi.create.foundation.utility.AngleHelper; +import com.simibubi.create.foundation.utility.MatrixStacker; +import com.simibubi.create.foundation.utility.VecHelper; + +import net.minecraft.block.BlockState; +import net.minecraft.item.ItemStack; +import net.minecraft.state.properties.AttachFace; +import net.minecraft.tileentity.TileEntityType; +import net.minecraft.util.Direction; +import net.minecraft.util.Direction.Axis; +import net.minecraft.util.math.Vec3d; +import net.minecraftforge.fluids.FluidStack; + +public class SmartFluidPipeTileEntity extends SmartTileEntity { + + private FilteringBehaviour filter; + + public SmartFluidPipeTileEntity(TileEntityType tileEntityTypeIn) { + super(tileEntityTypeIn); + } + + @Override + public void addBehaviours(List behaviours) { + behaviours.add(new SmartPipeBehaviour(this)); + behaviours.add(new StraightPipeAttachmentBehaviour(this)); + behaviours.add(filter = new FilteringBehaviour(this, new SmartPipeFilterSlot()).forFluids() + .withCallback(this::onFilterChanged)); + } + + private void onFilterChanged(ItemStack newFilter) { + if (world.isRemote) + return; + FluidPropagator.propagateChangedPipe(world, pos, getBlockState()); + } + + class SmartPipeBehaviour extends FluidPipeBehaviour { + + public SmartPipeBehaviour(SmartTileEntity te) { + super(te); + } + + @Override + public boolean canTransferToward(FluidStack fluid, BlockState state, Direction direction, boolean inbound) { + if (fluid.isEmpty() || filter != null && filter.test(fluid)) + return super.canTransferToward(fluid, state, direction, inbound); + return false; + } + + @Override + public boolean isConnectedTo(BlockState state, Direction direction) { + return state.getBlock() instanceof SmartFluidPipeBlock + && SmartFluidPipeBlock.getPipeAxis(state) == direction.getAxis(); + } + + } + + class SmartPipeFilterSlot extends ValueBoxTransform { + + @Override + protected Vec3d getLocalOffset(BlockState state) { + AttachFace face = state.get(SmartFluidPipeBlock.FACE); + float y = face == AttachFace.CEILING ? 0.3f : face == AttachFace.WALL ? 11.3f : 15.3f; + float z = face == AttachFace.CEILING ? 4.6f : face == AttachFace.WALL ? 0.6f : 4.6f; + return VecHelper.rotateCentered(VecHelper.voxelSpace(8, y, z), angleY(state), Axis.Y); + } + + @Override + protected void rotate(BlockState state, MatrixStack ms) { + AttachFace face = state.get(SmartFluidPipeBlock.FACE); + MatrixStacker.of(ms) + .rotateY(angleY(state)) + .rotateX(face == AttachFace.CEILING ? -45 : 45); + } + + protected float angleY(BlockState state) { + AttachFace face = state.get(SmartFluidPipeBlock.FACE); + float horizontalAngle = AngleHelper.horizontalAngle(state.get(SmartFluidPipeBlock.HORIZONTAL_FACING)); + if (face == AttachFace.WALL) + horizontalAngle += 180; + return horizontalAngle; + } + + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/StraightPipeTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/StraightPipeTileEntity.java index 3a19835f9..ff405c1f8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/StraightPipeTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/StraightPipeTileEntity.java @@ -10,6 +10,7 @@ import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import net.minecraft.block.BlockState; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; +import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; import net.minecraft.world.ILightReader; @@ -39,7 +40,7 @@ public class StraightPipeTileEntity extends SmartTileEntity { } - class StraightPipeAttachmentBehaviour extends FluidPipeAttachmentBehaviour { + static class StraightPipeAttachmentBehaviour extends FluidPipeAttachmentBehaviour { public StraightPipeAttachmentBehaviour(SmartTileEntity te) { super(te); @@ -49,17 +50,18 @@ public class StraightPipeTileEntity extends SmartTileEntity { public AttachmentTypes getAttachment(ILightReader world, BlockPos pos, BlockState state, Direction direction) { AttachmentTypes attachment = super.getAttachment(world, pos, state, direction); BlockState otherState = world.getBlockState(pos.offset(direction)); - if (state.getBlock() instanceof AxisPipeBlock && otherState.getBlock() instanceof AxisPipeBlock) { - if (state.get(AxisPipeBlock.AXIS) == otherState.get(AxisPipeBlock.AXIS)) { - if (state.getBlock() == otherState.getBlock() - || direction.getAxisDirection() == AxisDirection.POSITIVE) - return AttachmentTypes.NONE; - } - } + + Axis axis = IAxisPipe.getAxisOf(state); + Axis otherAxis = IAxisPipe.getAxisOf(otherState); + + if (axis == otherAxis && axis != null) + if (state.getBlock() == otherState.getBlock() || direction.getAxisDirection() == AxisDirection.POSITIVE) + return AttachmentTypes.NONE; + if (otherState.getBlock() instanceof FluidValveBlock && FluidValveBlock.getPipeAxis(otherState) == direction.getAxis()) return AttachmentTypes.NONE; - + return attachment; } diff --git a/src/main/java/com/simibubi/create/content/logistics/item/filter/FilterItem.java b/src/main/java/com/simibubi/create/content/logistics/item/filter/FilterItem.java index 67f6a9ac1..d66741e7c 100644 --- a/src/main/java/com/simibubi/create/content/logistics/item/filter/FilterItem.java +++ b/src/main/java/com/simibubi/create/content/logistics/item/filter/FilterItem.java @@ -34,6 +34,8 @@ import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.util.Constants.NBT; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.CapabilityFluidHandler; import net.minecraftforge.fml.network.NetworkHooks; import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemStackHandler; @@ -182,6 +184,10 @@ public class FilterItem extends Item implements INamedContainerProvider { return test(world, stack, filter, false); } + public static boolean test(World world, FluidStack stack, ItemStack filter) { + return test(world, stack, filter, false); + } + private static boolean test(World world, ItemStack stack, ItemStack filter, boolean matchNBT) { if (filter.isEmpty()) return true; @@ -251,4 +257,39 @@ public class FilterItem extends Item implements INamedContainerProvider { return false; } + private static boolean test(World world, FluidStack stack, ItemStack filter, boolean matchNBT) { + if (filter.isEmpty()) + return true; + if (stack.isEmpty()) + return false; + + if (!(filter.getItem() instanceof FilterItem)) { + if (!matchNBT) + return filter.getCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY) + .filter(ifh -> ifh.getTanks() > 0) + .map(ifh -> ifh.getFluidInTank(0) + .getFluid() == stack.getFluid()) + .orElse(false); + return stack.isFluidEqual(filter); + } + + if (AllItems.FILTER.get() == filter.getItem()) { + ItemStackHandler filterItems = getFilterItems(filter); + boolean respectNBT = filter.getOrCreateTag() + .getBoolean("RespectNBT"); + boolean blacklist = filter.getOrCreateTag() + .getBoolean("Blacklist"); + for (int slot = 0; slot < filterItems.getSlots(); slot++) { + ItemStack stackInSlot = filterItems.getStackInSlot(slot); + if (stackInSlot.isEmpty()) + continue; + boolean matches = test(world, stack, stackInSlot, respectNBT); + if (matches) + return !blacklist; + } + return blacklist; + } + return false; + } + } diff --git a/src/main/java/com/simibubi/create/foundation/data/recipe/StandardRecipeGen.java b/src/main/java/com/simibubi/create/foundation/data/recipe/StandardRecipeGen.java index f34c5f336..89a7b4710 100644 --- a/src/main/java/com/simibubi/create/foundation/data/recipe/StandardRecipeGen.java +++ b/src/main/java/com/simibubi/create/foundation/data/recipe/StandardRecipeGen.java @@ -427,6 +427,14 @@ public class StandardRecipeGen extends CreateRecipeProvider { .patternLine("P") .patternLine("S")), + SMART_FLUID_PIPE = create(AllBlocks.SMART_FLUID_PIPE).unlockedByTag(I::copper) + .viaShaped(b -> b.key('P', I.electronTube()) + .key('S', AllBlocks.FLUID_PIPE.get()) + .key('I', I.brassSheet()) + .patternLine("I") + .patternLine("S") + .patternLine("P")), + FLUID_VALVE = create(AllBlocks.FLUID_VALVE).unlockedByTag(I::copper) .viaShaped(b -> b.key('P', I.shaft()) .key('S', AllBlocks.FLUID_PIPE.get()) @@ -461,6 +469,12 @@ public class StandardRecipeGen extends CreateRecipeProvider { .patternLine("SCS") .patternLine(" I ")), + PORTABLE_STORAGE_INTERFACE = create(AllBlocks.PORTABLE_STORAGE_INTERFACE).unlockedBy(I::brassCasing) + .viaShaped(b -> b.key('I', AllBlocks.REDSTONE_CONTACT.get()) + .key('B', AllBlocks.ANDESITE_FUNNEL.get()) + .patternLine(" B ") + .patternLine(" I ")), + ROPE_PULLEY = create(AllBlocks.ROPE_PULLEY).unlockedBy(I::andesite) .viaShaped(b -> b.key('S', I.shaft()) .key('B', I.andesiteCasing()) diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java index dcd972552..0c4caec59 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java @@ -18,6 +18,7 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.Direction; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; public class FilteringBehaviour extends TileEntityBehaviour { @@ -37,6 +38,7 @@ public class FilteringBehaviour extends TileEntityBehaviour { int ticksUntilScrollPacket; boolean forceClientState; boolean recipeFilter; + boolean fluidFilter; public FilteringBehaviour(SmartTileEntity te, ValueBoxTransform slot) { super(te); @@ -51,6 +53,7 @@ public class FilteringBehaviour extends TileEntityBehaviour { ticksUntilScrollPacket = -1; showCountPredicate = () -> showCount; recipeFilter = false; + fluidFilter = false; } @Override @@ -102,6 +105,11 @@ public class FilteringBehaviour extends TileEntityBehaviour { recipeFilter = true; return this; } + + public FilteringBehaviour forFluids() { + fluidFilter = true; + return this; + } public FilteringBehaviour onlyActiveWhen(Supplier condition) { isActive = condition; @@ -169,6 +177,10 @@ public class FilteringBehaviour extends TileEntityBehaviour { public boolean test(ItemStack stack) { return !isActive() || filter.isEmpty() || FilterItem.test(tileEntity.getWorld(), stack, filter); } + + public boolean test(FluidStack stack) { + return !isActive() || filter.isEmpty() || FilterItem.test(tileEntity.getWorld(), stack, filter); + } @Override public BehaviourType getType() { diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringRenderer.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringRenderer.java index 0e649d425..025ad5a42 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringRenderer.java @@ -60,8 +60,10 @@ public class FilteringRenderer { ItemStack filter = behaviour.getFilter(); boolean isFilterSlotted = filter.getItem() instanceof FilterItem; boolean showCount = behaviour.isCountVisible(); + boolean fluids = behaviour.fluidFilter; String label = isFilterSlotted ? "" - : Lang.translate(behaviour.recipeFilter ? "logistics.recipe_filter" : "logistics.filter"); + : Lang.translate(behaviour.recipeFilter ? "logistics.recipe_filter" + : fluids ? "logistics.fluid_filter" : "logistics.filter"); boolean hit = behaviour.slotPositioning.testHit(state, target.getHitVec() .subtract(new Vec3d(pos))); @@ -72,7 +74,7 @@ public class FilteringRenderer { : new ValueBox(label, bb, pos); box.offsetLabel(behaviour.textShift) - .withColors(0x7A6A2C, 0xB79D64) + .withColors(fluids ? 0x407088 : 0x7A6A2C, fluids ? 0x70adb5 : 0xB79D64) .scrollTooltip(showCount ? "[" + Lang.translate("action.scroll") + "]" : "") .passive(!hit); @@ -118,7 +120,7 @@ public class FilteringRenderer { } sided.fromSide(side); return; - } else if(slotPositioning.shouldRender(blockState)) { + } else if (slotPositioning.shouldRender(blockState)) { ms.push(); slotPositioning.transform(blockState, ms); ValueBoxRenderer.renderItemIntoValueBox(behaviour.getFilter(), ms, buffer, light, overlay); diff --git a/src/main/resources/assets/create/lang/default/messages.json b/src/main/resources/assets/create/lang/default/messages.json index f76682dca..b61b73f9f 100644 --- a/src/main/resources/assets/create/lang/default/messages.json +++ b/src/main/resources/assets/create/lang/default/messages.json @@ -150,6 +150,7 @@ "create.logistics.filter": "Filter", "create.logistics.recipe_filter": "Recipe Filter", + "create.logistics.fluid_filter": "Fluid Filter", "create.logistics.firstFrequency": "Freq. #1", "create.logistics.secondFrequency": "Freq. #2", diff --git a/src/main/resources/assets/create/models/block/smart_fluid_pipe/block.json b/src/main/resources/assets/create/models/block/smart_fluid_pipe/block.json new file mode 100644 index 000000000..fcce391f5 --- /dev/null +++ b/src/main/resources/assets/create/models/block/smart_fluid_pipe/block.json @@ -0,0 +1,72 @@ +{ + "credit": "Made with Blockbench", + "parent": "block/block", + "textures": { + "1": "create:block/fluid_pipe", + "2": "create:block/smart_pipe_1", + "3": "create:block/smart_pipe_2", + "5": "create:block/brass_block", + "particle": "create:block/brass_block" + }, + "elements": [ + { + "from": [3, 3, 3], + "to": [13, 13, 13], + "faces": { + "north": {"uv": [3, 3, 13, 13], "rotation": 180, "texture": "#5"}, + "east": {"uv": [3, 3, 13, 13], "rotation": 180, "texture": "#2"}, + "south": {"uv": [3, 3, 13, 13], "rotation": 180, "texture": "#5"}, + "west": {"uv": [3, 3, 13, 13], "rotation": 180, "texture": "#2"}, + "up": {"uv": [3, 3, 13, 13], "rotation": 270, "texture": "#2"}, + "down": {"uv": [3, 3, 13, 13], "rotation": 90, "texture": "#2"} + } + }, + { + "from": [4, 4, 0], + "to": [12, 12, 4], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 0]}, + "faces": { + "east": {"uv": [0, 8, 4, 6], "rotation": 270, "texture": "#1"}, + "west": {"uv": [0, 8, 4, 6], "rotation": 90, "texture": "#1"}, + "up": {"uv": [0, 8, 4, 6], "rotation": 180, "texture": "#1"}, + "down": {"uv": [0, 8, 4, 6], "rotation": 180, "texture": "#1"} + } + }, + { + "from": [4, 4, 12], + "to": [12, 12, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 16]}, + "faces": { + "east": {"uv": [0, 6, 4, 8], "rotation": 270, "texture": "#1"}, + "west": {"uv": [0, 6, 4, 8], "rotation": 90, "texture": "#1"}, + "up": {"uv": [0, 6, 4, 8], "rotation": 180, "texture": "#1"}, + "down": {"uv": [0, 6, 4, 8], "rotation": 180, "texture": "#1"} + } + }, + { + "from": [4.5, 5, 4.15], + "to": [11.5, 12, 13.15], + "rotation": {"angle": 45, "axis": "x", "origin": [8, 12, 13]}, + "faces": { + "north": {"uv": [0, 7, 7, 14], "texture": "#3"}, + "east": {"uv": [0, 0, 9, 7], "texture": "#3"}, + "west": {"uv": [0, 0, 9, 7], "rotation": 180, "texture": "#3"}, + "up": {"uv": [0, 0, 9, 7], "rotation": 270, "texture": "#3"}, + "down": {"uv": [0, 0, 9, 7], "rotation": 90, "texture": "#3"} + } + }, + { + "from": [3.9, 4.4, 5.15], + "to": [12.1, 12.6, 7.15], + "rotation": {"angle": 45, "axis": "x", "origin": [8, 12, 13]}, + "faces": { + "north": {"uv": [8, 8, 16, 16], "texture": "#3"}, + "east": {"uv": [14, 0, 16, 8], "texture": "#3"}, + "south": {"uv": [8, 8, 16, 16], "texture": "#3"}, + "west": {"uv": [14, 0, 16, 8], "rotation": 180, "texture": "#3"}, + "up": {"uv": [14, 0, 16, 8], "rotation": 270, "texture": "#3"}, + "down": {"uv": [14, 0, 16, 8], "rotation": 90, "texture": "#3"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/smart_fluid_pipe/item.json b/src/main/resources/assets/create/models/block/smart_fluid_pipe/item.json new file mode 100644 index 000000000..460f0e833 --- /dev/null +++ b/src/main/resources/assets/create/models/block/smart_fluid_pipe/item.json @@ -0,0 +1,96 @@ +{ + "credit": "Made with Blockbench", + "parent": "block/block", + "textures": { + "1": "create:block/fluid_pipe", + "2": "create:block/smart_pipe_1", + "3": "create:block/smart_pipe_2" + }, + "elements": [ + { + "from": [3, 3, 3], + "to": [13, 13, 13], + "faces": { + "north": {"uv": [8, 9, 9, 10], "rotation": 180, "texture": "#3"}, + "east": {"uv": [3, 3, 13, 13], "rotation": 180, "texture": "#2"}, + "south": {"uv": [8, 9, 9, 10], "rotation": 180, "texture": "#3"}, + "west": {"uv": [3, 3, 13, 13], "rotation": 180, "texture": "#2"}, + "up": {"uv": [3, 3, 13, 13], "rotation": 270, "texture": "#2"}, + "down": {"uv": [3, 3, 13, 13], "rotation": 90, "texture": "#2"} + } + }, + { + "from": [4, 4, 0], + "to": [12, 12, 4], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 0]}, + "faces": { + "east": {"uv": [0, 8, 4, 6], "rotation": 270, "texture": "#1"}, + "west": {"uv": [0, 8, 4, 6], "rotation": 90, "texture": "#1"}, + "up": {"uv": [0, 8, 4, 6], "rotation": 180, "texture": "#1"}, + "down": {"uv": [0, 8, 4, 6], "rotation": 180, "texture": "#1"} + } + }, + { + "from": [4, 4, 12], + "to": [12, 12, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 16]}, + "faces": { + "east": {"uv": [0, 6, 4, 8], "rotation": 270, "texture": "#1"}, + "west": {"uv": [0, 6, 4, 8], "rotation": 90, "texture": "#1"}, + "up": {"uv": [0, 6, 4, 8], "rotation": 180, "texture": "#1"}, + "down": {"uv": [0, 6, 4, 8], "rotation": 180, "texture": "#1"} + } + }, + { + "from": [3, 3, 0], + "to": [13, 13, 2], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 0]}, + "faces": { + "north": {"uv": [6, 0, 11, 5], "rotation": 180, "texture": "#1"}, + "east": {"uv": [6, 6, 11, 5], "rotation": 90, "texture": "#1"}, + "south": {"uv": [6, 0, 11, 5], "rotation": 180, "texture": "#1"}, + "west": {"uv": [6, 6, 11, 5], "rotation": 90, "texture": "#1"}, + "up": {"uv": [6, 6, 11, 5], "rotation": 180, "texture": "#1"}, + "down": {"uv": [6, 6, 11, 5], "texture": "#1"} + } + }, + { + "from": [3, 3, 14], + "to": [13, 13, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 16]}, + "faces": { + "north": {"uv": [11, 0, 6, 5], "rotation": 180, "texture": "#1"}, + "east": {"uv": [6, 5, 11, 6], "rotation": 90, "texture": "#1"}, + "south": {"uv": [11, 0, 6, 5], "rotation": 180, "texture": "#1"}, + "west": {"uv": [6, 5, 11, 6], "rotation": 90, "texture": "#1"}, + "up": {"uv": [6, 5, 11, 6], "rotation": 180, "texture": "#1"}, + "down": {"uv": [6, 5, 11, 6], "texture": "#1"} + } + }, + { + "from": [4.5, 5, 4.15], + "to": [11.5, 12, 13.15], + "rotation": {"angle": 45, "axis": "x", "origin": [8, 12, 13]}, + "faces": { + "north": {"uv": [0, 7, 7, 14], "texture": "#3"}, + "east": {"uv": [0, 0, 9, 7], "texture": "#3"}, + "west": {"uv": [0, 0, 9, 7], "rotation": 180, "texture": "#3"}, + "up": {"uv": [0, 0, 9, 7], "rotation": 270, "texture": "#3"}, + "down": {"uv": [0, 0, 9, 7], "rotation": 90, "texture": "#3"} + } + }, + { + "from": [3.9, 4.4, 5.15], + "to": [12.1, 12.6, 7.15], + "rotation": {"angle": 45, "axis": "x", "origin": [8, 12, 13]}, + "faces": { + "north": {"uv": [8, 8, 16, 16], "texture": "#3"}, + "east": {"uv": [14, 0, 16, 8], "texture": "#3"}, + "south": {"uv": [8, 8, 16, 16], "texture": "#3"}, + "west": {"uv": [14, 0, 16, 8], "rotation": 180, "texture": "#3"}, + "up": {"uv": [14, 0, 16, 8], "rotation": 270, "texture": "#3"}, + "down": {"uv": [14, 0, 16, 8], "rotation": 90, "texture": "#3"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/textures/block/smart_pipe_1.png b/src/main/resources/assets/create/textures/block/smart_pipe_1.png new file mode 100644 index 0000000000000000000000000000000000000000..35462ac59a8544e4f9fb0884077eccdcd6b560d4 GIT binary patch literal 363 zcmV-x0hIoUP)TgB{|o~9Um3)Nc^Q6u`_14|ybHSlN2YuK=a&#*czN$N z!^?9lU;{v!L57GM{b2wZ4wBamT#DU*%j={6gEW17@qyvpH8uu*ZZ3w8U%!EAX88|b z%^-l+0C^!HhD+D(F)(})XW-}HV|e%UHG`0}D8omV+h7Ag@_hD_vAf{Y!QB53-@OC7 z;O|2L24-P)upu9Rd}3hWdC8!srNjV|C&>%2sDOC^WVlV{R^kH@W&kJ<#g#N(AALE{0xBnnTAVVIVU8vbJV@$EN*OYtrY13>yXxL6q&k4*Re4^jl;{Cz0E@bT+627YcXFwLd# z6)bL(xfR0zkUoA10S2%OK#IVI{F7n$`}QY;khCbn#~+^<7 zP&mM&@Y`>k(Faq55{=vTKV=Z$_zO3Hos)&Z*gy&#eb_7jDFg*NDEh(CxNq-W1}A4_ zumK>6vlpH*SX;@1Lm%c;^n?Uci(&xG)Y~`T!3_XefK4+@3~qpxr5xBvAV87`w@vM&;S4c07*qoM6N<$f=nr=6aWAK literal 0 HcmV?d00001