diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index caa157bcd..b6479389a 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -137,7 +137,7 @@ de8a40b7daf1497d5aecee47a43b3e0b1d030b00 assets/create/blockstates/fancy_scoria_ fc9ac0a7e7191b93516719455a17177fa6524ecc assets/create/blockstates/fancy_weathered_limestone_bricks_slab.json b2a7c321b1795f20e7433f81a55ce4683de081b8 assets/create/blockstates/fancy_weathered_limestone_bricks_stairs.json 6372fe02ba0065acb0758121c45a15a1a8fdc5de assets/create/blockstates/fancy_weathered_limestone_bricks_wall.json -3d97226b5e8d8f70ed08e45e78db1faf78d5e28b assets/create/blockstates/fluid_pipe.json +fe9169716dd21a81a3710a89f0a9b7ea4dcd4d51 assets/create/blockstates/fluid_pipe.json f0eaab18e16c4f3f65ebf3b55b08f0dc445720fe assets/create/blockstates/fluid_tank.json 5408d92ab02af86539ac42971d4033545970bb3a assets/create/blockstates/fluid_valve.json e9da1794b6ece7f9aa8bcb43d42c23a55446133b assets/create/blockstates/flywheel.json @@ -322,6 +322,7 @@ c8467d55bc22d2e2256b8b732c06c9fdc64d336f assets/create/blockstates/polished_weat 5d811eab3c5e8411f98e2ea98d93d35955ce18fc assets/create/blockstates/polished_weathered_limestone_slab.json acec6cdebe772ca72de94a85d98199e827495acb assets/create/blockstates/polished_weathered_limestone_stairs.json f42ad32aefcfa7ccc6287f57ee1a5f092b65126f assets/create/blockstates/polished_weathered_limestone_wall.json +3bb571d0a2597907bf3a30686b4bfa0841ac990a assets/create/blockstates/portable_fluid_interface.json 1b70b4e5792dccd2110b84e209016ac258005e28 assets/create/blockstates/portable_storage_interface.json 8296d43d5f1c2113012d127038fb319af83aaee4 assets/create/blockstates/powered_latch.json e8b0a401c10d1ba67ed71ba31bd5f9bc28571b65 assets/create/blockstates/powered_toggle_latch.json @@ -392,17 +393,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 -04f295b9cbe610bb3664e956437ae68d2a0776ad assets/create/lang/en_ud.json -3912eddc0fdb76afe08961c9d9ad9fe776fbbef5 assets/create/lang/en_us.json -66e50a9482f186f3b0b066bcc7a8d6194b5892b4 assets/create/lang/unfinished/de_de.json -d0adae002c2ca46ad24d4f08037308334c239c69 assets/create/lang/unfinished/fr_fr.json -98b6589d85a68eb4460a7d2da96816b026436c14 assets/create/lang/unfinished/it_it.json -9a9477f8257367993760fbc9e4b65a2d8190b868 assets/create/lang/unfinished/ja_jp.json -e9e466d962ccba589d6d14e37c82e98076a3e614 assets/create/lang/unfinished/ko_kr.json -9e8277f247b069bb45fd45b086a5138ec160847f assets/create/lang/unfinished/nl_nl.json -707ec25a7f45dd3dca8b96d4031b38d1be64f840 assets/create/lang/unfinished/pt_br.json -f645e781db3e254d64ea4b20a553e713bfca3610 assets/create/lang/unfinished/ru_ru.json -1e8a48a6ba2d7ec7947c312835c332e869757526 assets/create/lang/unfinished/zh_cn.json +67f9a92292948241e01ce6043445b2b3ddcf5350 assets/create/lang/en_ud.json +ea9f7788b7cae3ddd4ba1ae74c54f558d6b3f584 assets/create/lang/en_us.json +d2741d202f1b76c0c57fbd25d5f35cfab258edb0 assets/create/lang/unfinished/de_de.json +ce08c4a4163e667a5c20dfd241cb56b0ff5d064e assets/create/lang/unfinished/fr_fr.json +6fe663867f28389fdac5ac75a12089ca7279a0cb assets/create/lang/unfinished/it_it.json +28b1bbb303a20f43266ae089b5d8b920523ee854 assets/create/lang/unfinished/ja_jp.json +cfc50d41b77b5dfeb49da61b95496a65b3d71169 assets/create/lang/unfinished/ko_kr.json +9f9e817483a92c960db5a6cdd30e0c9e0ac0b2f3 assets/create/lang/unfinished/nl_nl.json +6d638fa512c863203ff7207c9a68782ba4fd9997 assets/create/lang/unfinished/pt_br.json +0dc96a32325dc79e7f0cf980a7011475aa22ecc3 assets/create/lang/unfinished/ru_ru.json +311937a993d6c186ba4c433cd7befca8e4da6d89 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 @@ -1438,6 +1439,7 @@ e95125318055b8557afd7d108488cf0bdd81fe49 assets/create/models/item/polished_scor 68fb04f7a89c8117bb641e347df9bfc1f1248335 assets/create/models/item/polished_weathered_limestone_slab.json 6d92ee7112aa20e8a1adfe73d8933031c299bed1 assets/create/models/item/polished_weathered_limestone_stairs.json b4995fb4799f33508cd6bf2ded80c0b3e866ad43 assets/create/models/item/polished_weathered_limestone_wall.json +0e5638cdbf04d7af2222ec15fbe1d960385ea237 assets/create/models/item/portable_fluid_interface.json 3bc60b0d9884c2ee0f1dd530e90fceb699eea737 assets/create/models/item/portable_storage_interface.json d3cfc1a1137c4bc98848947d425d2972df144c95 assets/create/models/item/powdered_obsidian.json 1e501c1f2e9250aaaadcf17db62646d08177d4e1 assets/create/models/item/powered_latch.json @@ -1652,6 +1654,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 +164563947ebd951d36a839ee0787714b104ba090 data/create/advancements/recipes/create.base/crafting/kinetics/portable_fluid_interface.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 @@ -2465,6 +2468,7 @@ c7029af40b6f5dd2cd8f2ae7dfb89b37074624e6 data/create/loot_tables/blocks/polished 93f7be402a8088d33a94954572e111bcd71f11c8 data/create/loot_tables/blocks/polished_weathered_limestone_slab.json 6ef650c723d409c7a678ffac45212e22e37581c0 data/create/loot_tables/blocks/polished_weathered_limestone_stairs.json 58715bc033e4740dbb754f91c93a22b9d06828e6 data/create/loot_tables/blocks/polished_weathered_limestone_wall.json +ac945ab9e78d52daff38b9c288824ec6f643b23a data/create/loot_tables/blocks/portable_fluid_interface.json fbe98efcb1a5970b6795fdbbb671fee704c0945f data/create/loot_tables/blocks/portable_storage_interface.json 6a46f00d9de7050eb9748d5dbed182caa6b29949 data/create/loot_tables/blocks/powered_latch.json a3fb7d3e3bf9dc73ce754002f10c469d57db1f71 data/create/loot_tables/blocks/powered_toggle_latch.json @@ -2664,7 +2668,8 @@ 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 +a8e996bed77d3d20725f9d592c250392b3adb106 data/create/recipes/crafting/kinetics/portable_fluid_interface.json +7ed5699349faf2981228769c873057105a5ea3ea 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 diff --git a/src/generated/resources/assets/create/blockstates/fluid_pipe.json b/src/generated/resources/assets/create/blockstates/fluid_pipe.json index a4cffcde7..3b646b920 100644 --- a/src/generated/resources/assets/create/blockstates/fluid_pipe.json +++ b/src/generated/resources/assets/create/blockstates/fluid_pipe.json @@ -303,8 +303,8 @@ { "when": { "west": "false", - "down": "false", "east": "true", + "down": "false", "up": "true" }, "apply": { @@ -314,8 +314,8 @@ { "when": { "west": "true", - "down": "false", "east": "false", + "down": "false", "up": "true" }, "apply": { @@ -325,8 +325,8 @@ { "when": { "west": "false", - "down": "true", "east": "true", + "down": "true", "up": "false" }, "apply": { @@ -336,8 +336,8 @@ { "when": { "west": "true", - "down": "true", "east": "false", + "down": "true", "up": "false" }, "apply": { @@ -347,8 +347,8 @@ { "when": { "west": "false", - "down": "true", "east": "false", + "down": "true", "up": "true" }, "apply": { @@ -358,8 +358,8 @@ { "when": { "west": "false", - "down": "false", "east": "false", + "down": "false", "up": "true" }, "apply": { @@ -369,8 +369,8 @@ { "when": { "west": "false", - "down": "true", "east": "false", + "down": "true", "up": "false" }, "apply": { @@ -380,8 +380,8 @@ { "when": { "west": "true", - "down": "false", "east": "true", + "down": "false", "up": "false" }, "apply": { @@ -391,8 +391,8 @@ { "when": { "west": "false", - "down": "false", "east": "true", + "down": "false", "up": "false" }, "apply": { @@ -402,8 +402,8 @@ { "when": { "west": "true", - "down": "false", "east": "false", + "down": "false", "up": "false" }, "apply": { @@ -413,8 +413,8 @@ { "when": { "west": "false", - "down": "false", "east": "false", + "down": "false", "up": "false" }, "apply": { diff --git a/src/generated/resources/assets/create/blockstates/portable_fluid_interface.json b/src/generated/resources/assets/create/blockstates/portable_fluid_interface.json new file mode 100644 index 000000000..e231a5b5a --- /dev/null +++ b/src/generated/resources/assets/create/blockstates/portable_fluid_interface.json @@ -0,0 +1,30 @@ +{ + "variants": { + "facing=down": { + "model": "create:block/portable_fluid_interface/block", + "x": 180 + }, + "facing=up": { + "model": "create:block/portable_fluid_interface/block" + }, + "facing=north": { + "model": "create:block/portable_fluid_interface/block", + "x": 90 + }, + "facing=south": { + "model": "create:block/portable_fluid_interface/block", + "x": 90, + "y": 180 + }, + "facing=west": { + "model": "create:block/portable_fluid_interface/block", + "x": 90, + "y": 270 + }, + "facing=east": { + "model": "create:block/portable_fluid_interface/block", + "x": 90, + "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 1e75bdd5e..a98ffe1fb 100644 --- a/src/generated/resources/assets/create/lang/en_ud.json +++ b/src/generated/resources/assets/create/lang/en_ud.json @@ -323,6 +323,7 @@ "block.create.polished_weathered_limestone_slab": "q\u0250\u05DFS \u01DDuo\u0287s\u01DD\u026F\u0131\uA780 p\u01DD\u0279\u01DD\u0265\u0287\u0250\u01DDM p\u01DD\u0265s\u0131\u05DFo\u0500", "block.create.polished_weathered_limestone_stairs": "s\u0279\u0131\u0250\u0287S \u01DDuo\u0287s\u01DD\u026F\u0131\uA780 p\u01DD\u0279\u01DD\u0265\u0287\u0250\u01DDM p\u01DD\u0265s\u0131\u05DFo\u0500", "block.create.polished_weathered_limestone_wall": "\u05DF\u05DF\u0250M \u01DDuo\u0287s\u01DD\u026F\u0131\uA780 p\u01DD\u0279\u01DD\u0265\u0287\u0250\u01DDM p\u01DD\u0265s\u0131\u05DFo\u0500", + "block.create.portable_fluid_interface": "\u01DD\u0254\u0250\u025F\u0279\u01DD\u0287uI p\u0131n\u05DF\u2132 \u01DD\u05DFq\u0250\u0287\u0279o\u0500", "block.create.portable_storage_interface": "\u01DD\u0254\u0250\u025F\u0279\u01DD\u0287uI \u01DDb\u0250\u0279o\u0287S \u01DD\u05DFq\u0250\u0287\u0279o\u0500", "block.create.powered_latch": "\u0265\u0254\u0287\u0250\uA780 p\u01DD\u0279\u01DD\u028Do\u0500", "block.create.powered_toggle_latch": "\u0265\u0254\u0287\u0250\uA780 \u01DD\u05DFbbo\u27D8 p\u01DD\u0279\u01DD\u028Do\u0500", diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index 1b4620c5e..c4d69c991 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -326,6 +326,7 @@ "block.create.polished_weathered_limestone_slab": "Polished Weathered Limestone Slab", "block.create.polished_weathered_limestone_stairs": "Polished Weathered Limestone Stairs", "block.create.polished_weathered_limestone_wall": "Polished Weathered Limestone Wall", + "block.create.portable_fluid_interface": "Portable Fluid Interface", "block.create.portable_storage_interface": "Portable Storage Interface", "block.create.powered_latch": "Powered Latch", "block.create.powered_toggle_latch": "Powered Toggle Latch", 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 31cd74c98..a0469d075 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: 1042", + "_": "Missing Localizations: 1043", "_": "->------------------------] Game Elements [------------------------<-", @@ -327,6 +327,7 @@ "block.create.polished_weathered_limestone_slab": "Polierte Verwitterte Kalksteinstufe", "block.create.polished_weathered_limestone_stairs": "UNLOCALIZED: Polished Weathered Limestone Stairs", "block.create.polished_weathered_limestone_wall": "UNLOCALIZED: Polished Weathered Limestone Wall", + "block.create.portable_fluid_interface": "UNLOCALIZED: Portable Fluid Interface", "block.create.portable_storage_interface": "UNLOCALIZED: Portable Storage Interface", "block.create.powered_latch": "UNLOCALIZED: Powered Latch", "block.create.powered_toggle_latch": "UNLOCALIZED: Powered Toggle Latch", 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 734ffd347..3827b205c 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: 671", + "_": "Missing Localizations: 672", "_": "->------------------------] Game Elements [------------------------<-", @@ -327,6 +327,7 @@ "block.create.polished_weathered_limestone_slab": "Dalle de calcaire patinées", "block.create.polished_weathered_limestone_stairs": "UNLOCALIZED: Polished Weathered Limestone Stairs", "block.create.polished_weathered_limestone_wall": "UNLOCALIZED: Polished Weathered Limestone Wall", + "block.create.portable_fluid_interface": "UNLOCALIZED: Portable Fluid Interface", "block.create.portable_storage_interface": "Interface de stockage portable", "block.create.powered_latch": "Verrou alimenté", "block.create.powered_toggle_latch": "Verrou alimenté à bascule", 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 7b822c68d..ec2e3e609 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: 655", + "_": "Missing Localizations: 656", "_": "->------------------------] Game Elements [------------------------<-", @@ -327,6 +327,7 @@ "block.create.polished_weathered_limestone_slab": "Lastra di Calcare Consumato Levigato", "block.create.polished_weathered_limestone_stairs": "UNLOCALIZED: Polished Weathered Limestone Stairs", "block.create.polished_weathered_limestone_wall": "UNLOCALIZED: Polished Weathered Limestone Wall", + "block.create.portable_fluid_interface": "UNLOCALIZED: Portable Fluid Interface", "block.create.portable_storage_interface": "Interfaccia di Archiviazione Portatile", "block.create.powered_latch": "Leva Alimentata", "block.create.powered_toggle_latch": "Leva Alimentata Alterata", 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 b8dbdb671..8283f2543 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: 654", + "_": "Missing Localizations: 655", "_": "->------------------------] Game Elements [------------------------<-", @@ -327,6 +327,7 @@ "block.create.polished_weathered_limestone_slab": "磨かれた風化石灰岩のハーフブロック", "block.create.polished_weathered_limestone_stairs": "UNLOCALIZED: Polished Weathered Limestone Stairs", "block.create.polished_weathered_limestone_wall": "UNLOCALIZED: Polished Weathered Limestone Wall", + "block.create.portable_fluid_interface": "UNLOCALIZED: Portable Fluid Interface", "block.create.portable_storage_interface": "ポータブルストレージインターフェイス", "block.create.powered_latch": "パワードラッチ", "block.create.powered_toggle_latch": "パワードトグルラッチ", 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 3a019fae3..67dd3c869 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: 655", + "_": "Missing Localizations: 656", "_": "->------------------------] Game Elements [------------------------<-", @@ -327,6 +327,7 @@ "block.create.polished_weathered_limestone_slab": "윤나는 풍화된 석회암 반 블록", "block.create.polished_weathered_limestone_stairs": "UNLOCALIZED: Polished Weathered Limestone Stairs", "block.create.polished_weathered_limestone_wall": "UNLOCALIZED: Polished Weathered Limestone Wall", + "block.create.portable_fluid_interface": "UNLOCALIZED: Portable Fluid Interface", "block.create.portable_storage_interface": "이동식 저장소 인터페이스", "block.create.powered_latch": "레드스톤 걸쇠", "block.create.powered_toggle_latch": "레드스톤 토글 걸쇠", 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 f622b9656..b87dccf6b 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: 983", + "_": "Missing Localizations: 984", "_": "->------------------------] Game Elements [------------------------<-", @@ -327,6 +327,7 @@ "block.create.polished_weathered_limestone_slab": "Gepolijste Verweerde Kalksteen Plaat", "block.create.polished_weathered_limestone_stairs": "UNLOCALIZED: Polished Weathered Limestone Stairs", "block.create.polished_weathered_limestone_wall": "UNLOCALIZED: Polished Weathered Limestone Wall", + "block.create.portable_fluid_interface": "UNLOCALIZED: Portable Fluid Interface", "block.create.portable_storage_interface": "UNLOCALIZED: Portable Storage Interface", "block.create.powered_latch": "UNLOCALIZED: Powered Latch", "block.create.powered_toggle_latch": "UNLOCALIZED: Powered Toggle Latch", 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 80d89f6e0..14e55ca88 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: 1049", + "_": "Missing Localizations: 1050", "_": "->------------------------] Game Elements [------------------------<-", @@ -327,6 +327,7 @@ "block.create.polished_weathered_limestone_slab": "Lajota de Calcário Polido Resistido", "block.create.polished_weathered_limestone_stairs": "UNLOCALIZED: Polished Weathered Limestone Stairs", "block.create.polished_weathered_limestone_wall": "UNLOCALIZED: Polished Weathered Limestone Wall", + "block.create.portable_fluid_interface": "UNLOCALIZED: Portable Fluid Interface", "block.create.portable_storage_interface": "UNLOCALIZED: Portable Storage Interface", "block.create.powered_latch": "UNLOCALIZED: Powered Latch", "block.create.powered_toggle_latch": "UNLOCALIZED: Powered Toggle Latch", 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 76a352012..ad536d123 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: 324", + "_": "Missing Localizations: 325", "_": "->------------------------] Game Elements [------------------------<-", @@ -327,6 +327,7 @@ "block.create.polished_weathered_limestone_slab": "Плита из полированного выветренного известняка", "block.create.polished_weathered_limestone_stairs": "Ступени из полированного выветренного известняка", "block.create.polished_weathered_limestone_wall": "Стена из полированного выветренного известняка", + "block.create.portable_fluid_interface": "UNLOCALIZED: Portable Fluid Interface", "block.create.portable_storage_interface": "Портативный интерфейс хранения", "block.create.powered_latch": "Механизированная защёлка", "block.create.powered_toggle_latch": "Механизированная рычаг-защёлка", 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 8c1ef7e62..4e17d99ea 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: 337", + "_": "Missing Localizations: 338", "_": "->------------------------] Game Elements [------------------------<-", @@ -327,6 +327,7 @@ "block.create.polished_weathered_limestone_slab": "磨制风化石灰岩台阶", "block.create.polished_weathered_limestone_stairs": "磨制风化石灰岩楼梯", "block.create.polished_weathered_limestone_wall": "磨制风化石灰岩墙", + "block.create.portable_fluid_interface": "UNLOCALIZED: Portable Fluid Interface", "block.create.portable_storage_interface": "移动式存储接口", "block.create.powered_latch": "锁存器", "block.create.powered_toggle_latch": "T触发器", diff --git a/src/generated/resources/assets/create/models/item/portable_fluid_interface.json b/src/generated/resources/assets/create/models/item/portable_fluid_interface.json new file mode 100644 index 000000000..9418446e7 --- /dev/null +++ b/src/generated/resources/assets/create/models/item/portable_fluid_interface.json @@ -0,0 +1,3 @@ +{ + "parent": "create:block/portable_fluid_interface/item" +} \ No newline at end of file diff --git a/src/generated/resources/data/create/advancements/recipes/create.base/crafting/kinetics/portable_fluid_interface.json b/src/generated/resources/data/create/advancements/recipes/create.base/crafting/kinetics/portable_fluid_interface.json new file mode 100644 index 000000000..2b2f247b3 --- /dev/null +++ b/src/generated/resources/data/create/advancements/recipes/create.base/crafting/kinetics/portable_fluid_interface.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "create:crafting/kinetics/portable_fluid_interface" + ] + }, + "criteria": { + "has_item": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:copper_casing" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "create:crafting/kinetics/portable_fluid_interface" + } + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/loot_tables/blocks/portable_fluid_interface.json b/src/generated/resources/data/create/loot_tables/blocks/portable_fluid_interface.json new file mode 100644 index 000000000..d4f291dad --- /dev/null +++ b/src/generated/resources/data/create/loot_tables/blocks/portable_fluid_interface.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "create:portable_fluid_interface" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/recipes/crafting/kinetics/portable_fluid_interface.json b/src/generated/resources/data/create/recipes/crafting/kinetics/portable_fluid_interface.json new file mode 100644 index 000000000..61bf4785c --- /dev/null +++ b/src/generated/resources/data/create/recipes/crafting/kinetics/portable_fluid_interface.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " B ", + " I " + ], + "key": { + "I": { + "item": "create:copper_casing" + }, + "B": { + "item": "create:andesite_funnel" + } + }, + "result": { + "item": "create:portable_fluid_interface" + } +} \ 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 index 87f103a47..ee961eefa 100644 --- 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 @@ -6,7 +6,7 @@ ], "key": { "I": { - "item": "create:redstone_contact" + "item": "create:brass_casing" }, "B": { "item": "create:andesite_funnel" diff --git a/src/main/java/com/simibubi/create/AllBlockPartials.java b/src/main/java/com/simibubi/create/AllBlockPartials.java index 4cfe13d22..7fdcfb261 100644 --- a/src/main/java/com/simibubi/create/AllBlockPartials.java +++ b/src/main/java/com/simibubi/create/AllBlockPartials.java @@ -88,6 +88,10 @@ public class AllBlockPartials { PORTABLE_STORAGE_INTERFACE_MIDDLE = get("portable_storage_interface/block_middle"), PORTABLE_STORAGE_INTERFACE_MIDDLE_POWERED = get("portable_storage_interface/block_middle_powered"), PORTABLE_STORAGE_INTERFACE_TOP = get("portable_storage_interface/block_top"), + + PORTABLE_FLUID_INTERFACE_MIDDLE = get("portable_fluid_interface/block_middle"), + PORTABLE_FLUID_INTERFACE_MIDDLE_POWERED = get("portable_fluid_interface/block_middle_powered"), + PORTABLE_FLUID_INTERFACE_TOP = get("portable_fluid_interface/block_top"), ARM_COG = get("mechanical_arm/cog"), ARM_BASE = get("mechanical_arm/base"), ARM_LOWER_BODY = get("mechanical_arm/lower_body"), ARM_UPPER_BODY = get("mechanical_arm/upper_body"), diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index e48a3ac76..d235fc682 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -630,6 +630,15 @@ public class AllBlocks { .item(BasinOperatorBlockItem::new) .transform(customItemModel()) .register(); + + public static final BlockEntry PORTABLE_FLUID_INTERFACE = + REGISTRATE.block("portable_fluid_interface", PortableStorageInterfaceBlock::forFluids) + .initialProperties(SharedProperties::softMetal) + .blockstate((c, p) -> p.directionalBlock(c.get(), AssetLookup.partialBaseModel(c, p))) + .onRegister(addMovementBehaviour(new PortableStorageInterfaceMovement())) + .item() + .transform(customItemModel()) + .register(); // Contraptions @@ -791,7 +800,7 @@ public class AllBlocks { .register(); public static final BlockEntry PORTABLE_STORAGE_INTERFACE = - REGISTRATE.block("portable_storage_interface", PortableStorageInterfaceBlock::new) + REGISTRATE.block("portable_storage_interface", PortableStorageInterfaceBlock::forItems) .initialProperties(SharedProperties::stone) .blockstate((c, p) -> p.directionalBlock(c.get(), AssetLookup.partialBaseModel(c, p))) .onRegister(addMovementBehaviour(new PortableStorageInterfaceMovement())) diff --git a/src/main/java/com/simibubi/create/AllTileEntities.java b/src/main/java/com/simibubi/create/AllTileEntities.java index 8d24eb6bc..aba35da40 100644 --- a/src/main/java/com/simibubi/create/AllTileEntities.java +++ b/src/main/java/com/simibubi/create/AllTileEntities.java @@ -5,8 +5,9 @@ import com.simibubi.create.content.contraptions.components.actors.DrillRenderer; import com.simibubi.create.content.contraptions.components.actors.DrillTileEntity; import com.simibubi.create.content.contraptions.components.actors.HarvesterRenderer; import com.simibubi.create.content.contraptions.components.actors.HarvesterTileEntity; +import com.simibubi.create.content.contraptions.components.actors.PortableFluidInterfaceTileEntity; +import com.simibubi.create.content.contraptions.components.actors.PortableItemInterfaceTileEntity; import com.simibubi.create.content.contraptions.components.actors.PortableStorageInterfaceRenderer; -import com.simibubi.create.content.contraptions.components.actors.PortableStorageInterfaceTileEntity; import com.simibubi.create.content.contraptions.components.clock.CuckooClockRenderer; import com.simibubi.create.content.contraptions.components.clock.CuckooClockTileEntity; import com.simibubi.create.content.contraptions.components.crafter.MechanicalCrafterRenderer; @@ -349,13 +350,19 @@ public class AllTileEntities { .renderer(() -> HarvesterRenderer::new) .register(); - public static final TileEntityEntry PORTABLE_STORAGE_INTERFACE = + public static final TileEntityEntry PORTABLE_STORAGE_INTERFACE = Create.registrate() - .tileEntity("portable_storage_interface", PortableStorageInterfaceTileEntity::new) + .tileEntity("portable_storage_interface", PortableItemInterfaceTileEntity::new) .validBlocks(AllBlocks.PORTABLE_STORAGE_INTERFACE) .renderer(() -> PortableStorageInterfaceRenderer::new) .register(); + public static final TileEntityEntry PORTABLE_FLUID_INTERFACE = Create.registrate() + .tileEntity("portable_fluid_interface", PortableFluidInterfaceTileEntity::new) + .validBlocks(AllBlocks.PORTABLE_FLUID_INTERFACE) + .renderer(() -> PortableStorageInterfaceRenderer::new) + .register(); + public static final TileEntityEntry FLYWHEEL = Create.registrate() .tileEntity("flywheel", FlywheelTileEntity::new) .validBlocks(AllBlocks.FLYWHEEL) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableFluidInterfaceTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableFluidInterfaceTileEntity.java new file mode 100644 index 000000000..981213c94 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableFluidInterfaceTileEntity.java @@ -0,0 +1,113 @@ +package com.simibubi.create.content.contraptions.components.actors; + +import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; + +import net.minecraft.tileentity.TileEntityType; +import net.minecraft.util.Direction; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fluids.capability.templates.FluidTank; + +public class PortableFluidInterfaceTileEntity extends PortableStorageInterfaceTileEntity { + + protected LazyOptional capability; + + public PortableFluidInterfaceTileEntity(TileEntityType tileEntityTypeIn) { + super(tileEntityTypeIn); + capability = createEmptyHandler(); + } + + @Override + public void startTransferringTo(Contraption contraption, float distance) { + LazyOptional oldcap = capability; + capability = LazyOptional.of(() -> new InterfaceFluidHandler(contraption.fluidInventory)); + oldcap.invalidate(); + super.startTransferringTo(contraption, distance); + } + + @Override + protected void invalidateCapability() { + capability.invalidate(); + } + + @Override + protected void stopTransferring() { + LazyOptional oldcap = capability; + capability = createEmptyHandler(); + oldcap.invalidate(); + } + + private LazyOptional createEmptyHandler() { + return LazyOptional.of(() -> new InterfaceFluidHandler(new FluidTank(0))); + } + + @Override + public LazyOptional getCapability(Capability cap, Direction side) { + if (isFluidHandlerCap(cap)) + return capability.cast(); + return super.getCapability(cap, side); + } + + class InterfaceFluidHandler implements IFluidHandler { + + private IFluidHandler wrapped; + + public InterfaceFluidHandler(IFluidHandler wrapped) { + this.wrapped = wrapped; + } + + @Override + public int getTanks() { + return wrapped.getTanks(); + } + + @Override + public FluidStack getFluidInTank(int tank) { + return wrapped.getFluidInTank(tank); + } + + @Override + public int getTankCapacity(int tank) { + return wrapped.getTankCapacity(tank); + } + + @Override + public boolean isFluidValid(int tank, FluidStack stack) { + return wrapped.isFluidValid(tank, stack); + } + + @Override + public int fill(FluidStack resource, FluidAction action) { + if (!isConnected()) + return 0; + int fill = wrapped.fill(resource, action); + if (fill > 0 && action.execute()) + onContentTransferred(); + return fill; + } + + @Override + public FluidStack drain(FluidStack resource, FluidAction action) { + if (!isConnected()) + return FluidStack.EMPTY; + FluidStack drain = wrapped.drain(resource, action); + if (!drain.isEmpty() && action.execute()) + onContentTransferred(); + return drain; + } + + @Override + public FluidStack drain(int maxDrain, FluidAction action) { + if (!isConnected()) + return FluidStack.EMPTY; + FluidStack drain = wrapped.drain(maxDrain, action); + if (!drain.isEmpty() && (action.execute() || drain.getAmount() == 1)) + onContentTransferred(); + return drain; + } + + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableItemInterfaceTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableItemInterfaceTileEntity.java new file mode 100644 index 000000000..1642a30ed --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableItemInterfaceTileEntity.java @@ -0,0 +1,78 @@ +package com.simibubi.create.content.contraptions.components.actors; + +import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; +import com.simibubi.create.foundation.item.ItemHandlerWrapper; + +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityType; +import net.minecraft.util.Direction; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.items.IItemHandlerModifiable; +import net.minecraftforge.items.ItemStackHandler; + +public class PortableItemInterfaceTileEntity extends PortableStorageInterfaceTileEntity { + + protected LazyOptional capability; + + public PortableItemInterfaceTileEntity(TileEntityType tileEntityTypeIn) { + super(tileEntityTypeIn); + capability = LazyOptional.empty(); + } + + @Override + public void startTransferringTo(Contraption contraption, float distance) { + LazyOptional oldCap = capability; + capability = LazyOptional.of(() -> new InterfaceItemHandler(contraption.inventory)); + oldCap.invalidate(); + super.startTransferringTo(contraption, distance); + } + + @Override + protected void stopTransferring() { + LazyOptional oldCap = capability; + capability = LazyOptional.of(() -> new InterfaceItemHandler(new ItemStackHandler(0))); + oldCap.invalidate(); + } + + @Override + protected void invalidateCapability() { + capability.invalidate(); + } + + @Override + public LazyOptional getCapability(Capability cap, Direction side) { + if (isItemHandlerCap(cap)) + return capability.cast(); + return super.getCapability(cap, side); + } + + class InterfaceItemHandler extends ItemHandlerWrapper { + + public InterfaceItemHandler(IItemHandlerModifiable wrapped) { + super(wrapped); + } + + @Override + public ItemStack extractItem(int slot, int amount, boolean simulate) { + if (!isConnected()) + return ItemStack.EMPTY; + ItemStack extractItem = super.extractItem(slot, amount, simulate); + if (!simulate && !extractItem.isEmpty()) + onContentTransferred(); + return extractItem; + } + + @Override + public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { + if (!isConnected()) + return stack; + ItemStack insertItem = super.insertItem(slot, stack, simulate); + if (!simulate && !insertItem.equals(stack, false)) + onContentTransferred(); + return insertItem; + } + + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceBlock.java index 078b33117..7afae49c4 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceBlock.java @@ -8,6 +8,7 @@ import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.block.ProperDirectionalBlock; import mcp.MethodsReturnNonnullByDefault; +import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; import net.minecraft.tileentity.TileEntity; @@ -22,8 +23,19 @@ import net.minecraft.world.World; public class PortableStorageInterfaceBlock extends ProperDirectionalBlock implements ITE { - public PortableStorageInterfaceBlock(Properties p_i48415_1_) { + boolean fluids; + + public static PortableStorageInterfaceBlock forItems(Properties p_i48415_1_) { + return new PortableStorageInterfaceBlock(p_i48415_1_, false); + } + + public static PortableStorageInterfaceBlock forFluids(Properties p_i48415_1_) { + return new PortableStorageInterfaceBlock(p_i48415_1_, true); + } + + private PortableStorageInterfaceBlock(Properties p_i48415_1_, boolean fluids) { super(p_i48415_1_); + this.fluids = fluids; } @Override @@ -33,7 +45,14 @@ public class PortableStorageInterfaceBlock extends ProperDirectionalBlock @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return AllTileEntities.PORTABLE_STORAGE_INTERFACE.create(); + return (fluids ? AllTileEntities.PORTABLE_FLUID_INTERFACE : AllTileEntities.PORTABLE_STORAGE_INTERFACE) + .create(); + } + + @Override + public void neighborChanged(BlockState state, World world, BlockPos pos, Block p_220069_4_, BlockPos p_220069_5_, + boolean p_220069_6_) { + withTileEntityDo(world, pos, PortableStorageInterfaceTileEntity::neighbourChanged); } @Override @@ -54,11 +73,8 @@ public class PortableStorageInterfaceBlock extends ProperDirectionalBlock @Override public int getComparatorInputOverride(BlockState blockState, World worldIn, BlockPos pos) { - try { - return getTileEntity(worldIn, pos).isConnected() ? 15 : 0; - } catch (TileEntityException e) { - } - return 0; + return getTileEntityOptional(worldIn, pos).map(te -> te.isConnected() ? 15 : 0) + .orElse(0); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceMovement.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceMovement.java index a3ff3fa8b..bfb1fbca9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceMovement.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceMovement.java @@ -3,7 +3,6 @@ package com.simibubi.create.content.contraptions.components.actors; import java.util.Optional; import com.mojang.blaze3d.matrix.MatrixStack; -import com.simibubi.create.AllBlocks; import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.foundation.utility.VecHelper; @@ -50,11 +49,12 @@ public class PortableStorageInterfaceMovement extends MovementBehaviour { return false; Direction currentFacing = currentFacingIfValid.get(); - PortableStorageInterfaceTileEntity psi = findStationaryInterface(context.world, pos, currentFacing); + PortableStorageInterfaceTileEntity psi = + findStationaryInterface(context.world, pos, context.state, currentFacing); if (psi == null) return false; - if (psi.isTransferring() && !context.world.isRemote) + if ((psi.isTransferring() || psi.isPowered()) && !context.world.isRemote) return false; context.data.put(_workingPos_, NBTUtil.writeBlockPos(psi.getPos())); if (!context.world.isRemote) { @@ -94,7 +94,7 @@ public class PortableStorageInterfaceMovement extends MovementBehaviour { return; PortableStorageInterfaceTileEntity stationaryInterface = - getStationaryInterfaceAt(context.world, pos, currentFacingIfValid.get()); + getStationaryInterfaceAt(context.world, pos, context.state, currentFacingIfValid.get()); if (stationaryInterface == null || !stationaryInterface.isTransferring()) { reset(context); return; @@ -112,10 +112,11 @@ public class PortableStorageInterfaceMovement extends MovementBehaviour { context.stall = false; } - private PortableStorageInterfaceTileEntity findStationaryInterface(World world, BlockPos pos, Direction facing) { + private PortableStorageInterfaceTileEntity findStationaryInterface(World world, BlockPos pos, BlockState state, + Direction facing) { for (int i = 0; i < 2; i++) { PortableStorageInterfaceTileEntity interfaceAt = - getStationaryInterfaceAt(world, pos.offset(facing, i), facing); + getStationaryInterfaceAt(world, pos.offset(facing, i), state, facing); if (interfaceAt == null) continue; return interfaceAt; @@ -123,12 +124,13 @@ public class PortableStorageInterfaceMovement extends MovementBehaviour { return null; } - private PortableStorageInterfaceTileEntity getStationaryInterfaceAt(World world, BlockPos pos, Direction facing) { + private PortableStorageInterfaceTileEntity getStationaryInterfaceAt(World world, BlockPos pos, BlockState state, + Direction facing) { TileEntity te = world.getTileEntity(pos); if (!(te instanceof PortableStorageInterfaceTileEntity)) return null; BlockState blockState = world.getBlockState(pos); - if (!AllBlocks.PORTABLE_STORAGE_INTERFACE.has(blockState)) + if (blockState.getBlock() != state.getBlock()) return null; if (blockState.get(PortableStorageInterfaceBlock.FACING) != facing.getOpposite()) return null; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceRenderer.java index 9efa6b692..c45de1c3f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceRenderer.java @@ -5,6 +5,7 @@ import java.util.function.Consumer; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; import com.simibubi.create.AllBlockPartials; +import com.simibubi.create.AllBlocks; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer; import com.simibubi.create.foundation.utility.AngleHelper; @@ -33,7 +34,8 @@ public class PortableStorageInterfaceRenderer extends SafeTileEntityRenderer sbb.light(light).renderInto(ms, vb), ms); + render(blockState, progress, te.isConnected(), sbb -> sbb.light(light) + .renderInto(ms, vb), ms); } public static void renderInContraption(MovementContext context, MatrixStack ms, MatrixStack msLocal, @@ -43,14 +45,14 @@ public class PortableStorageInterfaceRenderer extends SafeTileEntityRenderer sbb.light(msLocal.peek() .getModel()) .renderInto(ms, vb), ms, msLocal); @@ -77,10 +79,8 @@ public class PortableStorageInterfaceRenderer extends SafeTileEntityRenderer capability; protected LerpedFloat connectionAnimation; + protected boolean powered; public PortableStorageInterfaceTileEntity(TileEntityType tileEntityTypeIn) { super(tileEntityTypeIn); transferTimer = 0; - capability = LazyOptional.empty(); - connectionAnimation = LerpedFloat.linear().startWithValue(0); + connectionAnimation = LerpedFloat.linear() + .startWithValue(0); + powered = false; } public void startTransferringTo(Contraption contraption, float distance) { - capability.invalidate(); - capability = LazyOptional.of(() -> new InterfaceItemHandler(contraption.inventory)); this.distance = distance; startConnecting(); notifyUpdate(); } + protected abstract void stopTransferring(); + + protected abstract void invalidateCapability(); + @Override public void tick() { super.tick(); boolean wasConnected = isConnected(); - + if (transferTimer > 0) { transferTimer--; - if (transferTimer == 0) - capability.invalidate(); + if (transferTimer == 0 || powered) + stopTransferring(); } - + boolean isConnected = isConnected(); if (wasConnected != isConnected && !world.isRemote) markDirty(); - + float progress = 0; int timeUnit = getTransferTimeout() / 2; if (isConnected) @@ -68,21 +65,41 @@ public class PortableStorageInterfaceTileEntity extends SmartTileEntity { progress = MathHelper.lerp(transferTimer / (float) timeUnit, 0, 1); connectionAnimation.setValue(progress); } - + + @Override + public void remove() { + super.remove(); + invalidateCapability(); + } + @Override protected void read(CompoundNBT compound, boolean clientPacket) { super.read(compound, clientPacket); transferTimer = compound.getInt("Timer"); distance = compound.getFloat("Distance"); + powered = compound.getBoolean("Powered"); } - + @Override protected void write(CompoundNBT compound, boolean clientPacket) { super.write(compound, clientPacket); compound.putInt("Timer", transferTimer); compound.putFloat("Distance", distance); + compound.putBoolean("Powered", powered); + } + + public void neighbourChanged() { + boolean isBlockPowered = world.isBlockPowered(pos); + if (isBlockPowered == powered) + return; + powered = isBlockPowered; + sendData(); } + public boolean isPowered() { + return powered; + } + @Override @OnlyIn(Dist.CLIENT) public AxisAlignedBB getRenderBoundingBox() { @@ -92,31 +109,24 @@ public class PortableStorageInterfaceTileEntity extends SmartTileEntity { public boolean isTransferring() { return transferTimer != 0; } - + boolean isConnected() { int timeUnit = getTransferTimeout() / 2; return transferTimer >= timeUnit && transferTimer <= timeUnit * 3; } - + float getExtensionDistance(float partialTicks) { return connectionAnimation.getValue(partialTicks) * distance / 2; } - + float getConnectionDistance() { return distance; } - @Override - public LazyOptional getCapability(Capability cap, Direction side) { - if (isItemHandlerCap(cap)) - return capability.cast(); - return super.getCapability(cap, side); - } - public void startConnecting() { transferTimer = getTransferTimeout() * 2; } - + public void onContentTransferred() { int timeUnit = getTransferTimeout() / 2; transferTimer = timeUnit * 3; @@ -130,32 +140,4 @@ public class PortableStorageInterfaceTileEntity extends SmartTileEntity { @Override public void addBehaviours(List behaviours) {} - class InterfaceItemHandler extends ItemHandlerWrapper { - - public InterfaceItemHandler(IItemHandlerModifiable wrapped) { - super(wrapped); - } - - @Override - public ItemStack extractItem(int slot, int amount, boolean simulate) { - if (!isConnected()) - return ItemStack.EMPTY; - ItemStack extractItem = super.extractItem(slot, amount, simulate); - if (!simulate && !extractItem.isEmpty()) - onContentTransferred(); - return extractItem; - } - - @Override - public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { - if (!isConnected()) - return stack; - ItemStack insertItem = super.insertItem(slot, stack, simulate); - if (!simulate && !insertItem.equals(stack, false)) - onContentTransferred(); - return insertItem; - } - - } - } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java index 3c3ecc0b2..c8bfc9585 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java @@ -223,6 +223,7 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit if (!initialized) contraptionInitialize(); + contraption.onEntityTick(world); tickContraption(); super.tick(); } @@ -351,22 +352,6 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit this.dataManager.register(STALLED, false); } - @Override - protected void readAdditional(CompoundNBT compound) { - initialized = compound.getBoolean("Initialized"); - contraption = Contraption.fromNBT(world, compound.getCompound("Contraption")); - contraption.entity = this; - dataManager.set(STALLED, compound.getBoolean("Stalled")); - } - - @Override - protected void writeAdditional(CompoundNBT compound) { - if (contraption != null) - compound.put("Contraption", contraption.writeNBT()); - compound.putBoolean("Stalled", isStalled()); - compound.putBoolean("Initialized", initialized); - } - @Override public IPacket createSpawnPacket() { return NetworkHooks.getEntitySpawningPacket(this); @@ -375,13 +360,37 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit @Override public void writeSpawnData(PacketBuffer buffer) { CompoundNBT compound = new CompoundNBT(); - writeAdditional(compound); + writeAdditional(compound, true); buffer.writeCompoundTag(compound); } + + @Override + protected final void writeAdditional(CompoundNBT compound) { + writeAdditional(compound, false); + } + + protected void writeAdditional(CompoundNBT compound, boolean spawnPacket) { + if (contraption != null) + compound.put("Contraption", contraption.writeNBT(spawnPacket)); + compound.putBoolean("Stalled", isStalled()); + compound.putBoolean("Initialized", initialized); + } @Override public void readSpawnData(PacketBuffer additionalData) { - readAdditional(additionalData.readCompoundTag()); + readAdditional(additionalData.readCompoundTag(), true); + } + + @Override + protected final void readAdditional(CompoundNBT compound) { + readAdditional(compound, false); + } + + protected void readAdditional(CompoundNBT compound, boolean spawnData) { + initialized = compound.getBoolean("Initialized"); + contraption = Contraption.fromNBT(world, compound.getCompound("Contraption"), spawnData); + contraption.entity = this; + dataManager.set(STALLED, compound.getBoolean("Stalled")); } public void disassemble() { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java index 0f544f1cc..41e20d42b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java @@ -44,6 +44,7 @@ import com.simibubi.create.content.contraptions.relays.belt.BeltBlock; import com.simibubi.create.content.logistics.block.inventories.AdjustableCrateBlock; import com.simibubi.create.content.logistics.block.redstone.RedstoneContactBlock; import com.simibubi.create.foundation.config.AllConfigs; +import com.simibubi.create.foundation.fluid.CombinedTankWrapper; import com.simibubi.create.foundation.utility.BlockFace; import com.simibubi.create.foundation.utility.Iterate; import com.simibubi.create.foundation.utility.NBTHelper; @@ -81,6 +82,10 @@ import net.minecraft.world.World; import net.minecraft.world.gen.feature.template.Template.BlockInfo; import net.minecraftforge.common.util.Constants.BlockFlags; import net.minecraftforge.common.util.Constants.NBT; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidTank; +import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fluids.capability.templates.FluidTank; import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.wrapper.CombinedInvWrapper; @@ -88,12 +93,14 @@ public abstract class Contraption { public AbstractContraptionEntity entity; public CombinedInvWrapper inventory; + public CombinedTankWrapper fluidInventory; public AxisAlignedBB bounds; public BlockPos anchor; public boolean stalled; protected Map blocks; protected Map storage; + protected Map fluidStorage; protected List> actors; protected Set> superglue; protected List seats; @@ -105,7 +112,7 @@ public abstract class Contraption { private List pendingSubContraptions; // Client - public List renderedTileEntities; + public Map renderedTileEntities; public Contraption() { blocks = new HashMap<>(); @@ -114,9 +121,10 @@ public abstract class Contraption { actors = new ArrayList<>(); superglue = new HashSet<>(); seatMapping = new HashMap<>(); + fluidStorage = new HashMap<>(); glueToRemove = new ArrayList<>(); initialPassengers = new HashMap<>(); - renderedTileEntities = new ArrayList<>(); + renderedTileEntities = new HashMap<>(); pendingSubContraptions = new ArrayList<>(); stabilizedSubContraptions = new HashMap<>(); } @@ -140,10 +148,10 @@ public abstract class Contraption { return true; } - public static Contraption fromNBT(World world, CompoundNBT nbt) { + public static Contraption fromNBT(World world, CompoundNBT nbt, boolean spawnData) { String type = nbt.getString("Type"); Contraption contraption = AllContraptionTypes.fromType(type); - contraption.readNBT(world, nbt); + contraption.readNBT(world, nbt, spawnData); return contraption; } @@ -195,6 +203,13 @@ public abstract class Contraption { .map(MountedStorage::getItemHandler) .collect(Collectors.toList()); inventory = new CombinedInvWrapper(Arrays.copyOf(list.toArray(), list.size(), IItemHandlerModifiable[].class)); + + List fluidHandlers = fluidStorage.values() + .stream() + .map(MountedFluidStorage::getFluidHandler) + .collect(Collectors.toList()); + fluidInventory = new CombinedTankWrapper( + Arrays.copyOf(fluidHandlers.toArray(), fluidHandlers.size(), IFluidHandler[].class)); } public void onEntityInitialize(World world, AbstractContraptionEntity contraptionEntity) { @@ -218,6 +233,10 @@ public abstract class Contraption { } } + public void onEntityTick(World world) { + fluidStorage.forEach((pos, mfs) -> mfs.tick(entity, pos, world.isRemote)); + } + protected boolean moveBlock(World world, BlockPos pos, Direction forcedDirection, List frontier, Set visited) { visited.add(pos); @@ -449,6 +468,8 @@ public abstract class Contraption { TileEntity te = pair.getValue(); if (te != null && MountedStorage.canUseAsStorage(te)) storage.put(localPos, new MountedStorage(te)); + if (te != null && MountedFluidStorage.canUseAsStorage(te)) + fluidStorage.put(localPos, new MountedFluidStorage(te)); if (AllMovementBehaviours.contains(captured.state.getBlock())) actors.add(MutablePair.of(blockInfo, null)); } @@ -489,7 +510,7 @@ public abstract class Contraption { return pos.equals(anchor); } - public void readNBT(World world, CompoundNBT nbt) { + public void readNBT(World world, CompoundNBT nbt, boolean spawnData) { blocks.clear(); renderedTileEntities.clear(); @@ -528,7 +549,7 @@ public abstract class Contraption { if (te instanceof KineticTileEntity) ((KineticTileEntity) te).setSpeed(0); te.getBlockState(); - renderedTileEntities.add(te); + renderedTileEntities.put(info.pos, te); } }); @@ -560,6 +581,24 @@ public abstract class Contraption { NBTHelper.iterateCompoundList(nbt.getList("Storage", NBT.TAG_COMPOUND), c -> storage .put(NBTUtil.readBlockPos(c.getCompound("Pos")), MountedStorage.deserialize(c.getCompound("Data")))); + fluidStorage.clear(); + NBTHelper.iterateCompoundList(nbt.getList("FluidStorage", NBT.TAG_COMPOUND), c -> fluidStorage + .put(NBTUtil.readBlockPos(c.getCompound("Pos")), MountedFluidStorage.deserialize(c.getCompound("Data")))); + + if (spawnData) + fluidStorage.forEach((pos, mfs) -> { + TileEntity tileEntity = renderedTileEntities.get(pos); + if (!(tileEntity instanceof FluidTankTileEntity)) + return; + FluidTankTileEntity tank = (FluidTankTileEntity) tileEntity; + IFluidTank tankInventory = tank.getTankInventory(); + if (tankInventory instanceof FluidTank) + ((FluidTank) tankInventory).setFluid(mfs.tank.getFluid()); + tank.getFluidLevel() + .start(tank.getFillState()); + mfs.assignTileEntity(tank); + }); + IItemHandlerModifiable[] handlers = new IItemHandlerModifiable[storage.size()]; int index = 0; for (MountedStorage mountedStorage : storage.values()) @@ -573,7 +612,7 @@ public abstract class Contraption { anchor = NBTUtil.readBlockPos(nbt.getCompound("Anchor")); } - public CompoundNBT writeNBT() { + public CompoundNBT writeNBT(boolean spawnPacket) { CompoundNBT nbt = new CompoundNBT(); nbt.putString("Type", getType().id); ListNBT blocksNBT = new ListNBT(); @@ -606,14 +645,27 @@ public abstract class Contraption { } ListNBT storageNBT = new ListNBT(); - for (BlockPos pos : storage.keySet()) { + if (!spawnPacket) { + for (BlockPos pos : storage.keySet()) { + CompoundNBT c = new CompoundNBT(); + MountedStorage mountedStorage = storage.get(pos); + if (!mountedStorage.isValid()) + continue; + c.put("Pos", NBTUtil.writeBlockPos(pos)); + c.put("Data", mountedStorage.serialize()); + storageNBT.add(c); + } + } + + ListNBT fluidStorageNBT = new ListNBT(); + for (BlockPos pos : fluidStorage.keySet()) { CompoundNBT c = new CompoundNBT(); - MountedStorage mountedStorage = storage.get(pos); + MountedFluidStorage mountedStorage = fluidStorage.get(pos); if (!mountedStorage.isValid()) continue; c.put("Pos", NBTUtil.writeBlockPos(pos)); c.put("Data", mountedStorage.serialize()); - storageNBT.add(c); + fluidStorageNBT.add(c); } nbt.put("Seats", NBTHelper.writeCompoundList(getSeats(), NBTUtil::writeBlockPos)); @@ -636,6 +688,7 @@ public abstract class Contraption { nbt.put("Actors", actorsNBT); nbt.put("Superglue", superglueNBT); nbt.put("Storage", storageNBT); + nbt.put("FluidStorage", fluidStorageNBT); nbt.put("Anchor", NBTUtil.writeBlockPos(anchor)); nbt.putBoolean("Stalled", stalled); @@ -650,6 +703,8 @@ public abstract class Contraption { public void removeBlocksFromWorld(IWorld world, BlockPos offset) { storage.values() .forEach(MountedStorage::removeStorageFromWorld); + fluidStorage.values() + .forEach(MountedFluidStorage::removeStorageFromWorld); glueToRemove.forEach(SuperGlueEntity::remove); for (boolean brittles : Iterate.trueAndFalse) { @@ -750,6 +805,12 @@ public abstract class Contraption { if (mountedStorage.isValid()) mountedStorage.addStorageToWorld(tileEntity); } + + if (fluidStorage.containsKey(block.pos)) { + MountedFluidStorage mountedStorage = fluidStorage.get(block.pos); + if (mountedStorage.isValid()) + mountedStorage.addStorageToWorld(tileEntity); + } } } } @@ -868,4 +929,10 @@ public abstract class Contraption { return actors; } + public void updateContainedFluid(BlockPos localPos, FluidStack containedFluid) { + MountedFluidStorage mountedFluidStorage = fluidStorage.get(localPos); + if (mountedFluidStorage != null) + mountedFluidStorage.updateFluid(containedFluid); + } + } \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionRenderer.java index ac1093e1b..32398f9e5 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionRenderer.java @@ -71,7 +71,7 @@ public class ContraptionRenderer { private static void renderTileEntities(World world, Contraption c, MatrixStack ms, MatrixStack msLocal, IRenderTypeBuffer buffer) { - TileEntityRenderHelper.renderTileEntities(world, c.renderedTileEntities, ms, msLocal, buffer); + TileEntityRenderHelper.renderTileEntities(world, c.renderedTileEntities.values(), ms, msLocal, buffer); } private static SuperByteBuffer buildStructureBuffer(Contraption c, RenderType layer) { @@ -86,11 +86,13 @@ public class ContraptionRenderer { Random random = new Random(); BufferBuilder builder = new BufferBuilder(DefaultVertexFormats.BLOCK.getIntegerSize()); builder.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK); - renderWorld.setTileEntities(c.renderedTileEntities); + renderWorld.setTileEntities(c.renderedTileEntities.values()); - for (BlockInfo info : c.getBlocks().values()) + for (BlockInfo info : c.getBlocks() + .values()) renderWorld.setBlockState(info.pos, info.state); - for (BlockInfo info : c.getBlocks().values()) { + for (BlockInfo info : c.getBlocks() + .values()) { BlockState state = info.state; if (state.getRenderType() == BlockRenderType.ENTITYBLOCK_ANIMATED) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ControlledContraptionEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ControlledContraptionEntity.java index 415fdc885..cc3496b24 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ControlledContraptionEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ControlledContraptionEntity.java @@ -67,8 +67,8 @@ public class ControlledContraptionEntity extends AbstractContraptionEntity { } @Override - protected void readAdditional(CompoundNBT compound) { - super.readAdditional(compound); + protected void readAdditional(CompoundNBT compound, boolean spawnPacket) { + super.readAdditional(compound, spawnPacket); controllerPos = NBTUtil.readBlockPos(compound.getCompound("Controller")); if (compound.contains("Axis")) rotationAxis = NBTHelper.readEnum(compound, "Axis", Axis.class); @@ -76,8 +76,8 @@ public class ControlledContraptionEntity extends AbstractContraptionEntity { } @Override - protected void writeAdditional(CompoundNBT compound) { - super.writeAdditional(compound); + protected void writeAdditional(CompoundNBT compound, boolean spawnPacket) { + super.writeAdditional(compound, spawnPacket); compound.put("Controller", NBTUtil.writeBlockPos(controllerPos)); if (rotationAxis != null) NBTHelper.writeEnum(compound, "Axis", rotationAxis); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MountedFluidStorage.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MountedFluidStorage.java index 0617a77e1..135996fb4 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MountedFluidStorage.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MountedFluidStorage.java @@ -1,5 +1,170 @@ package com.simibubi.create.content.contraptions.components.structureMovement; +import com.simibubi.create.content.contraptions.components.structureMovement.sync.ContraptionFluidPacket; +import com.simibubi.create.content.contraptions.fluids.tank.CreativeFluidTankTileEntity; +import com.simibubi.create.content.contraptions.fluids.tank.CreativeFluidTankTileEntity.CreativeSmartFluidTank; +import com.simibubi.create.content.contraptions.fluids.tank.FluidTankTileEntity; +import com.simibubi.create.foundation.fluid.SmartFluidTank; +import com.simibubi.create.foundation.gui.widgets.InterpolatedChasingValue; +import com.simibubi.create.foundation.networking.AllPackets; +import com.simibubi.create.foundation.utility.NBTHelper; + +import net.minecraft.entity.Entity; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidTank; +import net.minecraftforge.fluids.capability.CapabilityFluidHandler; +import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fml.network.PacketDistributor; + public class MountedFluidStorage { + SmartFluidTank tank; + private boolean valid; + private TileEntity te; + + private int packetCooldown = 0; + private boolean sendPacket = false; + + public static boolean canUseAsStorage(TileEntity te) { + if (te instanceof FluidTankTileEntity) + return ((FluidTankTileEntity) te).isController(); + return false; + } + + public MountedFluidStorage(TileEntity te) { + assignTileEntity(te); + } + + public void assignTileEntity(TileEntity te) { + this.te = te; + tank = createMountedTank(te); + } + + private SmartFluidTank createMountedTank(TileEntity te) { + if (te instanceof CreativeFluidTankTileEntity) + return new CreativeSmartFluidTank( + ((FluidTankTileEntity) te).getTotalTankSize() * FluidTankTileEntity.getCapacityMultiplier(), $ -> { + }); + if (te instanceof FluidTankTileEntity) + return new SmartFluidTank( + ((FluidTankTileEntity) te).getTotalTankSize() * FluidTankTileEntity.getCapacityMultiplier(), + this::onFluidStackChanged); + return null; + } + + public void tick(Entity entity, BlockPos pos, boolean isRemote) { + if (!isRemote) { + if (packetCooldown > 0) + packetCooldown--; + else if (sendPacket) { + sendPacket = false; + AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> entity), + new ContraptionFluidPacket(entity.getEntityId(), pos, tank.getFluid())); + packetCooldown = 8; + } + return; + } + + if (!(te instanceof FluidTankTileEntity)) + return; + FluidTankTileEntity tank = (FluidTankTileEntity) te; + tank.getFluidLevel() + .tick(); + } + + public void updateFluid(FluidStack fluid) { + tank.setFluid(fluid); + if (!(te instanceof FluidTankTileEntity)) + return; + float fillState = tank.getFluidAmount() / (float) tank.getCapacity(); + FluidTankTileEntity tank = (FluidTankTileEntity) te; + if (tank.getFluidLevel() == null) + tank.setFluidLevel(new InterpolatedChasingValue().start(fillState)); + tank.getFluidLevel() + .target(fillState); + IFluidTank tankInventory = tank.getTankInventory(); + if (tankInventory instanceof SmartFluidTank) + ((SmartFluidTank) tankInventory).setFluid(fluid); + } + + public void removeStorageFromWorld() { + valid = false; + if (te == null) + return; + + IFluidHandler teHandler = te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) + .orElse(null); + if (!(teHandler instanceof SmartFluidTank)) + return; + SmartFluidTank smartTank = (SmartFluidTank) teHandler; + tank.setFluid(smartTank.getFluid()); + sendPacket = false; + valid = true; + } + + private void onFluidStackChanged(FluidStack fs) { + sendPacket = true; + } + + public void addStorageToWorld(TileEntity te) { + if (tank instanceof CreativeSmartFluidTank) + return; + + LazyOptional capability = te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY); + IFluidHandler teHandler = capability.orElse(null); + if (!(teHandler instanceof SmartFluidTank)) + return; + + SmartFluidTank inv = (SmartFluidTank) teHandler; + inv.setFluid(tank.getFluid()); + } + + public IFluidHandler getFluidHandler() { + return tank; + } + + public CompoundNBT serialize() { + if (!valid) + return null; + CompoundNBT tag = tank.writeToNBT(new CompoundNBT()); + tag.putInt("Capacity", tank.getCapacity()); + + if (tank instanceof CreativeSmartFluidTank) { + NBTHelper.putMarker(tag, "Bottomless"); + tag.put("ProvidedStack", tank.getFluid() + .writeToNBT(new CompoundNBT())); + } + return tag; + } + + public static MountedFluidStorage deserialize(CompoundNBT nbt) { + MountedFluidStorage storage = new MountedFluidStorage(null); + if (nbt == null) + return storage; + + int capacity = nbt.getInt("Capacity"); + storage.tank = new SmartFluidTank(capacity, storage::onFluidStackChanged); + storage.valid = true; + + if (nbt.contains("Bottomless")) { + FluidStack providedStack = FluidStack.loadFluidStackFromNBT(nbt.getCompound("ProvidedStack")); + CreativeSmartFluidTank creativeSmartFluidTank = new CreativeSmartFluidTank(capacity, $ -> { + }); + creativeSmartFluidTank.setContainedFluid(providedStack); + storage.tank = creativeSmartFluidTank; + return storage; + } + + storage.tank.readFromNBT(nbt); + return storage; + } + + public boolean isValid() { + return valid; + } + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MountedStorage.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MountedStorage.java index e1b17a9e0..02ce47715 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MountedStorage.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MountedStorage.java @@ -31,7 +31,7 @@ public class MountedStorage { public static boolean canUseAsStorage(TileEntity te) { if (te == null) return false; - + if (AllTileEntities.ADJUSTABLE_CRATE.is(te)) return true; if (AllTileEntities.CREATIVE_CRATE.is(te)) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/OrientedContraptionEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/OrientedContraptionEntity.java index fc1c04a42..801cdee3b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/OrientedContraptionEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/OrientedContraptionEntity.java @@ -146,8 +146,8 @@ public class OrientedContraptionEntity extends AbstractContraptionEntity { } @Override - protected void readAdditional(CompoundNBT compound) { - super.readAdditional(compound); + protected void readAdditional(CompoundNBT compound, boolean spawnPacket) { + super.readAdditional(compound, spawnPacket); if (compound.contains("InitialOrientation")) setInitialOrientation(NBTHelper.readEnum(compound, "InitialOrientation", Direction.class)); @@ -170,8 +170,8 @@ public class OrientedContraptionEntity extends AbstractContraptionEntity { } @Override - protected void writeAdditional(CompoundNBT compound) { - super.writeAdditional(compound); + protected void writeAdditional(CompoundNBT compound, boolean spawnPacket) { + super.writeAdditional(compound, spawnPacket); if (motionBeforeStall != null) compound.put("CachedMotion", diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java index 8614d6c60..63f141114 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java @@ -62,18 +62,18 @@ public class BearingContraption extends Contraption { } @Override - public CompoundNBT writeNBT() { - CompoundNBT tag = super.writeNBT(); + public CompoundNBT writeNBT(boolean spawnPacket) { + CompoundNBT tag = super.writeNBT(spawnPacket); tag.putInt("Sails", sailBlocks); tag.putInt("Facing", facing.getIndex()); return tag; } @Override - public void readNBT(World world, CompoundNBT tag) { + public void readNBT(World world, CompoundNBT tag, boolean spawnData) { sailBlocks = tag.getInt("Sails"); facing = Direction.byIndex(tag.getInt("Facing")); - super.readNBT(world, tag); + super.readNBT(world, tag, spawnData); } public int getSailBlocks() { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkContraption.java index 7a772108d..31b7709f3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkContraption.java @@ -100,8 +100,8 @@ public class ClockworkContraption extends Contraption { } @Override - public CompoundNBT writeNBT() { - CompoundNBT tag = super.writeNBT(); + public CompoundNBT writeNBT(boolean spawnPacket) { + CompoundNBT tag = super.writeNBT(spawnPacket); tag.putInt("facing", facing.getIndex()); tag.putInt("offset", offset); NBTHelper.writeEnum(tag, "HandType", handType); @@ -109,11 +109,11 @@ public class ClockworkContraption extends Contraption { } @Override - public void readNBT(World world, CompoundNBT tag) { + public void readNBT(World world, CompoundNBT tag, boolean spawnData) { facing = Direction.byIndex(tag.getInt("Facing")); handType = NBTHelper.readEnum(tag, "HandType", HandType.class); offset = tag.getInt("offset"); - super.readNBT(world, tag); + super.readNBT(world, tag, spawnData); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java index 2e70f6f92..f54d09beb 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java @@ -42,16 +42,16 @@ public class StabilizedContraption extends Contraption { } @Override - public CompoundNBT writeNBT() { - CompoundNBT tag = super.writeNBT(); + public CompoundNBT writeNBT(boolean spawnPacket) { + CompoundNBT tag = super.writeNBT(spawnPacket); tag.putInt("Facing", facing.getIndex()); return tag; } @Override - public void readNBT(World world, CompoundNBT tag) { + public void readNBT(World world, CompoundNBT tag, boolean spawnData) { facing = Direction.byIndex(tag.getInt("Facing")); - super.readNBT(world, tag); + super.readNBT(world, tag, spawnData); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MinecartContraptionItem.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MinecartContraptionItem.java index b3822ff1c..94ae89035 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MinecartContraptionItem.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MinecartContraptionItem.java @@ -167,7 +167,7 @@ public class MinecartContraptionItem extends Item { intialOrientation = Optional.of(NBTHelper.readEnum(contraptionTag, "InitialOrientation", Direction.class)); - Contraption mountedContraption = Contraption.fromNBT(world, contraptionTag); + Contraption mountedContraption = Contraption.fromNBT(world, contraptionTag, false); OrientedContraptionEntity contraptionEntity = OrientedContraptionEntity.create(world, mountedContraption, intialOrientation); @@ -220,7 +220,7 @@ public class MinecartContraptionItem extends Item { public static ItemStack create(Type type, OrientedContraptionEntity entity) { ItemStack stack = ItemStack.EMPTY; - + switch (type) { case RIDEABLE: stack = AllItems.MINECART_CONTRAPTION.asStack(); @@ -234,12 +234,12 @@ public class MinecartContraptionItem extends Item { default: break; } - + if (stack.isEmpty()) return stack; CompoundNBT tag = entity.getContraption() - .writeNBT(); + .writeNBT(false); tag.remove("UUID"); tag.remove("Pos"); tag.remove("Motion"); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java index 47c47f5f1..3d6a28dd8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java @@ -126,16 +126,16 @@ public class MountedContraption extends Contraption { } @Override - public CompoundNBT writeNBT() { - CompoundNBT writeNBT = super.writeNBT(); - NBTHelper.writeEnum(writeNBT, "RotationMode", rotationMode); - return writeNBT; + public CompoundNBT writeNBT(boolean spawnPacket) { + CompoundNBT tag = super.writeNBT(spawnPacket); + NBTHelper.writeEnum(tag, "RotationMode", rotationMode); + return tag; } @Override - public void readNBT(World world, CompoundNBT nbt) { + public void readNBT(World world, CompoundNBT nbt, boolean spawnData) { rotationMode = NBTHelper.readEnum(nbt, "RotationMode", CartMovementMode.class); - super.readNBT(world, nbt); + super.readNBT(world, nbt, spawnData); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java index eb786c14e..9c67056ee 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java @@ -203,20 +203,20 @@ public class PistonContraption extends TranslatingContraption { } @Override - public void readNBT(World world, CompoundNBT nbt) { - super.readNBT(world, nbt); + public void readNBT(World world, CompoundNBT nbt, boolean spawnData) { + super.readNBT(world, nbt, spawnData); initialExtensionProgress = nbt.getInt("InitialLength"); extensionLength = nbt.getInt("ExtensionLength"); orientation = Direction.byIndex(nbt.getInt("Orientation")); } @Override - public CompoundNBT writeNBT() { - CompoundNBT nbt = super.writeNBT(); - nbt.putInt("InitialLength", initialExtensionProgress); - nbt.putInt("ExtensionLength", extensionLength); - nbt.putInt("Orientation", orientation.getIndex()); - return nbt; + public CompoundNBT writeNBT(boolean spawnPacket) { + CompoundNBT tag = super.writeNBT(spawnPacket); + tag.putInt("InitialLength", initialExtensionProgress); + tag.putInt("ExtensionLength", extensionLength); + tag.putInt("Orientation", orientation.getIndex()); + return tag; } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyContraption.java index 021206c24..d4a48a889 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyContraption.java @@ -41,16 +41,16 @@ public class PulleyContraption extends TranslatingContraption { } @Override - public CompoundNBT writeNBT() { - CompoundNBT writeNBT = super.writeNBT(); - writeNBT.putInt("InitialOffset", initialOffset); - return writeNBT; + public CompoundNBT writeNBT(boolean spawnPacket) { + CompoundNBT tag = super.writeNBT(spawnPacket); + tag.putInt("InitialOffset", initialOffset); + return tag; } @Override - public void readNBT(World world, CompoundNBT nbt) { + public void readNBT(World world, CompoundNBT nbt, boolean spawnData) { initialOffset = nbt.getInt("InitialOffset"); - super.readNBT(world, nbt); + super.readNBT(world, nbt, spawnData); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/sync/ContraptionFluidPacket.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/sync/ContraptionFluidPacket.java new file mode 100644 index 000000000..bc0d308bd --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/sync/ContraptionFluidPacket.java @@ -0,0 +1,53 @@ +package com.simibubi.create.content.contraptions.components.structureMovement.sync; + +import java.util.function.Supplier; + +import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity; +import com.simibubi.create.foundation.networking.SimplePacketBase; + +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fml.network.NetworkEvent.Context; + +public class ContraptionFluidPacket extends SimplePacketBase { + + private int entityId; + private BlockPos localPos; + private FluidStack containedFluid; + + public ContraptionFluidPacket(int entityId, BlockPos localPos, FluidStack containedFluid) { + this.entityId = entityId; + this.localPos = localPos; + this.containedFluid = containedFluid; + } + + public ContraptionFluidPacket(PacketBuffer buffer) { + entityId = buffer.readInt(); + localPos = buffer.readBlockPos(); + containedFluid = FluidStack.readFromPacket(buffer); + } + + @Override + public void write(PacketBuffer buffer) { + buffer.writeInt(entityId); + buffer.writeBlockPos(localPos); + containedFluid.writeToPacket(buffer); + } + + @Override + public void handle(Supplier context) { + context.get() + .enqueueWork(() -> { + Entity entityByID = Minecraft.getInstance().world.getEntityByID(entityId); + if (!(entityByID instanceof AbstractContraptionEntity)) + return; + AbstractContraptionEntity contraptionEntity = (AbstractContraptionEntity) entityByID; + contraptionEntity.getContraption().updateContainedFluid(localPos, containedFluid); + }); + context.get() + .setPacketHandled(true); + } +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidFX.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidFX.java index 6f02282af..21a7bdd33 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidFX.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidFX.java @@ -68,7 +68,7 @@ public class FluidFX { vec = VecHelper.clampComponentWise(vec, rimRadius) .mul(VecHelper.axisAlingedPlaneOf(directionVec)) .add(directionVec.scale(.45 + r.nextFloat() / 16f)); - Vec3d m = vec; + Vec3d m = vec.scale(.05f); vec = vec.add(VecHelper.getCenterOf(pos)); world.addOptionalParticle(particle, vec.x, vec.y - 1 / 16f, vec.z, m.x, m.y, m.z); diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/CreativeFluidTankTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/CreativeFluidTankTileEntity.java index aeb03c5f5..dfa661558 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/CreativeFluidTankTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/CreativeFluidTankTileEntity.java @@ -18,7 +18,7 @@ public class CreativeFluidTankTileEntity extends FluidTankTileEntity { return new CreativeSmartFluidTank(getCapacityMultiplier(), this::onFluidStackChanged); } - class CreativeSmartFluidTank extends SmartFluidTank { + public static class CreativeSmartFluidTank extends SmartFluidTank { public CreativeSmartFluidTank(int capacity, Consumer updateCallback) { super(capacity, updateCallback); @@ -33,7 +33,7 @@ public class CreativeFluidTankTileEntity extends FluidTankTileEntity { fluid = fluidStack.copy(); if (!fluidStack.isEmpty()) fluid.setAmount(getTankCapacity(0)); - notifyUpdate(); + onContentsChanged(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankItem.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankItem.java index d126ac868..da2ef25ad 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankItem.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankItem.java @@ -12,6 +12,7 @@ import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; public class FluidTankItem extends BlockItem { @@ -41,6 +42,13 @@ public class FluidTankItem extends BlockItem { nbt.remove("Height"); nbt.remove("Controller"); nbt.remove("LastKnownPos"); + if (nbt.contains("TankContent")) { + FluidStack fluid = FluidStack.loadFluidStackFromNBT(nbt.getCompound("TankContent")); + if (!fluid.isEmpty()) { + fluid.setAmount(Math.min(FluidTankTileEntity.getCapacityMultiplier(), fluid.getAmount())); + nbt.put("TankContent", fluid.writeToNBT(new CompoundNBT())); + } + } } return super.onBlockPlaced(p_195943_1_, p_195943_2_, p_195943_3_, p_195943_4_, p_195943_5_); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankTileEntity.java index 88717fd1a..bfe3857c4 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankTileEntity.java @@ -354,7 +354,7 @@ public class FluidTankTileEntity extends SmartTileEntity { fluidLevel.withSpeed(compound.contains("LazySync") ? 1 / 8f : 1 / 2f); } - protected float getFillState() { + public float getFillState() { return (float) tankInventory.getFluidAmount() / tankInventory.getCapacity(); } @@ -414,12 +414,20 @@ public class FluidTankTileEntity extends SmartTileEntity { return MAX_SIZE; } - protected static int getCapacityMultiplier() { + public static int getCapacityMultiplier() { return AllConfigs.SERVER.fluids.fluidTankCapacity.get() * 1000; } public static int getMaxHeight() { return AllConfigs.SERVER.fluids.fluidTankMaxHeight.get(); } + + public InterpolatedChasingValue getFluidLevel() { + return fluidLevel; + } + + public void setFluidLevel(InterpolatedChasingValue fluidLevel) { + this.fluidLevel = fluidLevel; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinMovementBehaviour.java index ba5788b1c..4412e0b0c 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinMovementBehaviour.java @@ -8,6 +8,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Mov import net.minecraft.entity.item.ItemEntity; import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; import net.minecraft.util.math.Vec3d; import net.minecraftforge.items.ItemStackHandler; @@ -51,10 +52,9 @@ public class BasinMovementBehaviour extends MovementBehaviour { } context.tileData.put(key, itemStackHandler.serializeNBT()); }); - context.contraption.renderedTileEntities.stream() - .filter(te -> te.getPos() - .equals(context.localPos) && te instanceof BasinTileEntity) - .forEach(te -> ((BasinTileEntity) te).readOnlyItems(context.tileData)); + TileEntity tileEntity = context.contraption.renderedTileEntities.get(context.localPos); + if (tileEntity instanceof BasinTileEntity) + ((BasinTileEntity) tileEntity).readOnlyItems(context.tileData); context.temporaryData = false; // did already dump, so can't any more } } 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 c8f1c91e3..e2ca5de45 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 @@ -499,7 +499,13 @@ public class StandardRecipeGen extends CreateRecipeProvider { .patternLine(" I ")), PORTABLE_STORAGE_INTERFACE = create(AllBlocks.PORTABLE_STORAGE_INTERFACE).unlockedBy(I::brassCasing) - .viaShaped(b -> b.key('I', AllBlocks.REDSTONE_CONTACT.get()) + .viaShaped(b -> b.key('I', I.brassCasing()) + .key('B', AllBlocks.ANDESITE_FUNNEL.get()) + .patternLine(" B ") + .patternLine(" I ")), + + PORTABLE_FLUID_INTERFACE = create(AllBlocks.PORTABLE_FLUID_INTERFACE).unlockedBy(I::copperCasing) + .viaShaped(b -> b.key('I', I.copperCasing()) .key('B', AllBlocks.ANDESITE_FUNNEL.get()) .patternLine(" B ") .patternLine(" I ")), diff --git a/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java b/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java index 30f793bb5..0d4dbf5fa 100644 --- a/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java +++ b/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java @@ -9,6 +9,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Con import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionStallPacket; import com.simibubi.create.content.contraptions.components.structureMovement.glue.GlueEffectPacket; import com.simibubi.create.content.contraptions.components.structureMovement.sync.ClientMotionPacket; +import com.simibubi.create.content.contraptions.components.structureMovement.sync.ContraptionFluidPacket; import com.simibubi.create.content.contraptions.components.structureMovement.sync.ContraptionInteractionPacket; import com.simibubi.create.content.contraptions.components.structureMovement.sync.ContraptionSeatMappingPacket; import com.simibubi.create.content.contraptions.components.structureMovement.sync.LimbSwingUpdatePacket; @@ -76,6 +77,7 @@ public enum AllPackets { LIMBSWING_UPDATE(LimbSwingUpdatePacket.class, LimbSwingUpdatePacket::new), MINECART_CONTROLLER(MinecartControllerUpdatePacket.class, MinecartControllerUpdatePacket::new), FLUID_SPLASH(FluidSplashPacket.class, FluidSplashPacket::new), + CONTRAPTION_FLUID(ContraptionFluidPacket.class, ContraptionFluidPacket::new), ; diff --git a/src/main/resources/assets/create/models/block/portable_fluid_interface/block.json b/src/main/resources/assets/create/models/block/portable_fluid_interface/block.json new file mode 100644 index 000000000..62c31c029 --- /dev/null +++ b/src/main/resources/assets/create/models/block/portable_fluid_interface/block.json @@ -0,0 +1,8 @@ +{ + "parent": "create:block/portable_storage_interface/block", + "textures": { + "0": "create:block/portable_fluid_interface", + "1": "create:block/copper_casing", + "particle": "create:block/copper_casing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/portable_fluid_interface/block_middle.json b/src/main/resources/assets/create/models/block/portable_fluid_interface/block_middle.json new file mode 100644 index 000000000..0b3d3ab30 --- /dev/null +++ b/src/main/resources/assets/create/models/block/portable_fluid_interface/block_middle.json @@ -0,0 +1,6 @@ +{ + "parent": "create:block/portable_storage_interface/block_middle", + "textures": { + "0": "create:block/portable_fluid_interface" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/portable_fluid_interface/block_middle_powered.json b/src/main/resources/assets/create/models/block/portable_fluid_interface/block_middle_powered.json new file mode 100644 index 000000000..c2a3789b4 --- /dev/null +++ b/src/main/resources/assets/create/models/block/portable_fluid_interface/block_middle_powered.json @@ -0,0 +1,6 @@ +{ + "parent": "create:block/portable_storage_interface/block_middle_powered", + "textures": { + "0": "create:block/portable_fluid_interface" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/portable_fluid_interface/block_top.json b/src/main/resources/assets/create/models/block/portable_fluid_interface/block_top.json new file mode 100644 index 000000000..ebd764857 --- /dev/null +++ b/src/main/resources/assets/create/models/block/portable_fluid_interface/block_top.json @@ -0,0 +1,6 @@ +{ + "parent": "create:block/portable_storage_interface/block_top", + "textures": { + "0": "create:block/portable_fluid_interface" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/portable_fluid_interface/item.json b/src/main/resources/assets/create/models/block/portable_fluid_interface/item.json new file mode 100644 index 000000000..ffa83d0d0 --- /dev/null +++ b/src/main/resources/assets/create/models/block/portable_fluid_interface/item.json @@ -0,0 +1,7 @@ +{ + "parent": "create:block/portable_storage_interface/item", + "textures": { + "0": "create:block/portable_fluid_interface", + "1": "create:block/copper_casing" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/portable_storage_interface/brass_casing.png b/src/main/resources/assets/create/models/block/portable_storage_interface/brass_casing.png deleted file mode 100644 index fb657ce47..000000000 Binary files a/src/main/resources/assets/create/models/block/portable_storage_interface/brass_casing.png and /dev/null differ diff --git a/src/main/resources/assets/create/models/block/portable_storage_interface/portable_storage_interface.bbmodel b/src/main/resources/assets/create/models/block/portable_storage_interface/portable_storage_interface.bbmodel deleted file mode 100644 index 579e9291e..000000000 --- a/src/main/resources/assets/create/models/block/portable_storage_interface/portable_storage_interface.bbmodel +++ /dev/null @@ -1 +0,0 @@ -{"meta":{"format_version":"3.2","model_format":"java_block","box_uv":false},"name":"item","ambientocclusion":true,"front_gui_light":false,"resolution":{"width":16,"height":16},"elements":[{"name":"cube","from":[2,10,2],"to":[14,19,14],"autouv":0,"color":4,"locked":false,"origin":[10,18,10],"faces":{"north":{"uv":[1,3.5,7,8],"texture":0},"east":{"uv":[1,3.5,7,8],"texture":0},"south":{"uv":[1,3.5,7,8],"texture":0},"west":{"uv":[1,3.5,7,8],"texture":0},"up":{"uv":[1.5,3.5,2,4],"texture":0},"down":{"uv":[0,0,12,12],"texture":null}},"uuid":"de312b34-6e0e-d92a-f0cc-2b14d972edb8"},{"name":"cube","from":[0,0,0],"to":[16,12,16],"autouv":0,"color":3,"locked":false,"origin":[8,8,8],"faces":{"north":{"uv":[0,10,8,16],"texture":0},"east":{"uv":[0,10,8,16],"texture":0},"south":{"uv":[0,10,8,16],"texture":0},"west":{"uv":[0,10,8,16],"texture":0},"up":{"uv":[0,0,16,16],"texture":1},"down":{"uv":[0,0,16,16],"texture":1}},"uuid":"d78fa319-b9a7-d009-a299-e17e3ecd7b4c"},{"name":"cube","from":[0,12,1.9],"to":[2,14.1,14.1],"autouv":0,"color":2,"locked":false,"origin":[8,20,10],"faces":{"north":{"uv":[7,10,8,11],"texture":0},"east":{"uv":[0,0,0,0],"texture":null},"south":{"uv":[0,10,1,11],"texture":0},"west":{"uv":[1,9,7,10],"texture":0},"up":{"uv":[0,2,2,14],"texture":1},"down":{"uv":[0,0,0,0],"texture":null}},"uuid":"e5ea8437-3bd2-3033-9cb1-bca2918ad937"},{"name":"cube","from":[14,12,2],"to":[16,14,14],"autouv":0,"color":4,"locked":false,"origin":[8,20,6],"faces":{"north":{"uv":[0,10,1,11],"texture":0},"east":{"uv":[1,9,7,10],"texture":0},"south":{"uv":[7,10,8,11],"texture":0},"west":{"uv":[0,0,0,0],"texture":null},"up":{"uv":[0,2,2,14],"rotation":180,"texture":1},"down":{"uv":[0,0,0,0],"texture":null}},"uuid":"ef15b8aa-40de-3212-db76-9fc6c9269236"},{"name":"cube","from":[2,12,0],"to":[14,14,16],"autouv":0,"color":0,"locked":false,"origin":[10,20,8],"faces":{"north":{"uv":[1,9,7,10],"texture":0},"east":{"uv":[0,10,8,11],"texture":0},"south":{"uv":[1,9,7,10],"texture":0},"west":{"uv":[0,10,8,11],"texture":0},"up":{"uv":[2,0,14,16],"texture":1},"down":{"uv":[0,0,0,0],"texture":null}},"uuid":"a11c9348-80ea-30fd-5b35-bf4fab00a286"},{"name":"cube","from":[3,16,3],"to":[13,23.1,13],"autouv":0,"color":2,"locked":false,"origin":[11,24,11],"faces":{"north":{"uv":[1.5,0,6.5,3.5],"texture":0},"east":{"uv":[1.5,0,6.5,3.5],"texture":0},"south":{"uv":[1.5,0,6.5,3.5],"texture":0},"west":{"uv":[1.5,0,6.5,3.5],"texture":0},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[0,0,0,0],"texture":null}},"uuid":"6a52cb20-69df-718c-97da-3c42422e07e0"},{"name":"cube","from":[1,23,1],"to":[15,25,15],"autouv":0,"color":6,"locked":false,"origin":[8,24,8],"faces":{"north":{"uv":[8.5,15,15.5,16],"texture":0},"east":{"uv":[8.5,15,15.5,16],"texture":0},"south":{"uv":[8.5,15,15.5,16],"texture":0},"west":{"uv":[8.5,15,15.5,16],"texture":0},"up":{"uv":[8.5,8,15.5,15],"texture":0},"down":{"uv":[8.5,8,15.5,15],"texture":0}},"uuid":"323ba350-4ba9-9942-b94e-9918f2cb06bd"},{"name":"cube","from":[4,22.1,13],"to":[6,24.1,14],"autouv":0,"color":7,"locked":false,"rotation":[45,0,0],"origin":[8,23,13],"faces":{"north":{"uv":[0,0,0,0],"texture":null},"east":{"uv":[7.5,10,8,10.5],"texture":0},"south":{"uv":[10,15,11,16],"texture":0},"west":{"uv":[7.5,10,8,10.5],"texture":0},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[0,0,0,0],"texture":null}},"uuid":"1d3cd83e-6fc4-5767-4de6-42d59581a66b"},{"name":"cube","from":[10,22.1,2],"to":[12,24.1,3],"autouv":0,"color":5,"locked":false,"rotation":[-45,0,0],"origin":[8,23,3],"faces":{"north":{"uv":[10,15,11,16],"texture":0},"east":{"uv":[7.5,10,8,10.5],"texture":0},"south":{"uv":[0,0,0,0],"texture":null},"west":{"uv":[7.5,10,8,10.5],"texture":0},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[0,0,0,0],"texture":null}},"uuid":"ff86b4f3-c6ea-e7e4-228a-a2b21aca7a25"},{"name":"cube","from":[2,22.1,4],"to":[3,24.1,6],"autouv":0,"color":7,"locked":false,"rotation":[0,0,45],"origin":[3,23,8],"faces":{"north":{"uv":[7.5,10,8,10.5],"texture":0},"east":{"uv":[0,0,0,0],"texture":null},"south":{"uv":[7.5,10,8,10.5],"texture":0},"west":{"uv":[10,15,11,16],"texture":0},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[0,0,0,0],"texture":null}},"uuid":"f689fb7a-a97d-fd81-c390-380f16371935"},{"name":"cube","from":[13,22.1,10],"to":[14,24.1,12],"autouv":0,"color":6,"locked":false,"rotation":[0,0,-45],"origin":[13,23,8],"faces":{"north":{"uv":[7.5,10,8,10.5],"texture":0},"east":{"uv":[10,15,11,16],"texture":0},"south":{"uv":[7.5,10,8,10.5],"texture":0},"west":{"uv":[0,0,0,0],"texture":null},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[0,0,0,0],"texture":null}},"uuid":"848d1774-ecae-9eb6-f536-e332161c0954"},{"name":"cube","from":[10,22.1,13],"to":[12,24.1,14],"autouv":0,"color":6,"locked":false,"rotation":[45,0,0],"origin":[8,23,13],"faces":{"north":{"uv":[0,0,0,0],"texture":null},"east":{"uv":[7.5,10,8,10.5],"texture":0},"south":{"uv":[13,15,14,16],"texture":0},"west":{"uv":[7.5,10,8,10.5],"texture":0},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[0,0,0,0],"texture":null}},"uuid":"c71a2559-c9eb-ea19-f432-00ef36482906"},{"name":"cube","from":[4,22.1,2],"to":[6,24.1,3],"autouv":0,"color":7,"locked":false,"rotation":[-45,0,0],"origin":[8,23,3],"faces":{"north":{"uv":[13,15,14,16],"texture":0},"east":{"uv":[7.5,10,8,10.5],"texture":0},"south":{"uv":[0,0,0,0],"texture":null},"west":{"uv":[7.5,10,8,10.5],"texture":0},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[0,0,0,0],"texture":null}},"uuid":"76250b0e-a72a-5cf0-e6fe-92819c986668"},{"name":"cube","from":[2,22.1,10],"to":[3,24.1,12],"autouv":0,"color":1,"locked":false,"rotation":[0,0,45],"origin":[3,23,8],"faces":{"north":{"uv":[7.5,10,8,10.5],"texture":0},"east":{"uv":[0,0,0,0],"texture":null},"south":{"uv":[7.5,10,8,10.5],"texture":0},"west":{"uv":[13,15,14,16],"texture":0},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[0,0,0,0],"texture":null}},"uuid":"df73a796-af5b-89a2-cd8e-ba9c3babf799"},{"name":"cube","from":[13,22.1,4],"to":[14,24.1,6],"autouv":0,"color":6,"locked":false,"rotation":[0,0,-45],"origin":[13,23,8],"faces":{"north":{"uv":[7.5,10,8,10.5],"texture":0},"east":{"uv":[13,15,14,16],"texture":0},"south":{"uv":[7.5,10,8,10.5],"texture":0},"west":{"uv":[0,0,0,0],"texture":null},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[0,0,0,0],"texture":null}},"uuid":"3c79817e-58ff-9c30-ebcf-3bba7ec9e870"}],"outliner":[{"name":"Middle","uuid":"264b83b8-efae-9137-aa5e-0226a71ebafb","export":true,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"origin":[10,22,10],"children":["de312b34-6e0e-d92a-f0cc-2b14d972edb8"]},{"name":"block","uuid":"bd1a7e4e-8dfb-30c7-82be-0b25df157ef2","export":true,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"origin":[8,8,8],"children":[{"name":"Base","uuid":"2cfb4e18-3aea-9f2f-2880-12edf0e1d861","export":true,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"origin":[10,20,8],"children":["d78fa319-b9a7-d009-a299-e17e3ecd7b4c","e5ea8437-3bd2-3033-9cb1-bca2918ad937","ef15b8aa-40de-3212-db76-9fc6c9269236","a11c9348-80ea-30fd-5b35-bf4fab00a286"]}]},{"name":"block_top","uuid":"0073ff5f-cbc9-63c3-ee64-74a557d08b5f","export":true,"isOpen":false,"locked":false,"visibility":true,"autouv":0,"origin":[8,8,8],"children":[{"name":"Top","uuid":"c293d84e-c942-8907-cf16-62a51d3e9ef3","export":true,"isOpen":false,"locked":false,"visibility":true,"autouv":0,"origin":[10,22,10],"children":["6a52cb20-69df-718c-97da-3c42422e07e0","323ba350-4ba9-9942-b94e-9918f2cb06bd","1d3cd83e-6fc4-5767-4de6-42d59581a66b","ff86b4f3-c6ea-e7e4-228a-a2b21aca7a25","f689fb7a-a97d-fd81-c390-380f16371935","848d1774-ecae-9eb6-f536-e332161c0954","c71a2559-c9eb-ea19-f432-00ef36482906","76250b0e-a72a-5cf0-e6fe-92819c986668","df73a796-af5b-89a2-cd8e-ba9c3babf799","3c79817e-58ff-9c30-ebcf-3bba7ec9e870"]}]}],"textures":[{"path":"C:\\Users\\simon\\Desktop\\Forgespace 1.15\\Create\\src\\main\\resources\\assets\\create\\textures\\block\\portable_storage_interface.png","name":"portable_storage_interface.png","folder":"block","namespace":"create","id":"0","particle":true,"mode":"bitmap","saved":true,"uuid":"0539e8a0-cc65-561f-c3f4-7d4ec0ab322f","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAE2UlEQVRYR61XXWgcVRT+JtmdzM7+NDHRVh9U6EMTfWhMFJpKBDGSkgRSIWCC+OZDCyJowb6V4oNoRXwR1BdfRBJh0Qaa0GqqaOgPQv6w5KdapH3QxGyan01mJ7ObjJwzOZM7yRDoNAeWe++ZPfd8c36+uVeDIi2vvOo6Tok1uh4DzWWUv9F66OpPmmon8472drdUKiEWi7FK5qqO9JcGBnz7wEa0gW07MAydjUulTcRiZTyKjjZXN1CBRLEPADjR2upalgPTJACbgQiIjgBdvnIlNAJR7AMbUQosy4ZpGuxcDaHo9kpBFPsAgJeaX3aXV1ZwIJNh52uWhaRp8ig6SsFvw7+ERiCKfWCj403Nbm5hATXV1ey0UCggkUjwKDoCdP3GcCiAKPaBjY4ebXRVp2qBCRAaJyZGQgFEsfc36unpcYvFIui3l8TjcdCvt7c3ACKqvb9JV1eX+8yRIxgdH8fq4CCSANIAFqGhCi5mAaTa2tBQX4/JmRlks9kAANX+iYEBPAfgIICnAPy+Nf+6vX2Xvb9JZ2enu7ZqgbogffMaO81vgaCxBA35Yy8ikzFRYRjo7+8PAFDt37wxjAyAWgB3ARQA/ArgVlPzLnt/EyKRlRWLmY963WOyTR6FjIQZw7ggqr0PgEiEAFCbEQiKhFCq0LHwQhgXRLX3ARCJzOfuc9+TY+IDmnsRiAV4IYwLotr7AIhEZufmuO/JMfEBzUmEjKRFw7ggqr0PgEhkdu4/xGLl7DifX+U5iXBAqbThP9/JBVHtfQBEIuTUC3k5yJlI2Pr27cldJBbFPpTR9mSikIfd3d3uaj7PdfLZ6Uoszy7h/A9AZVUV/3tpcRHnXwMOHKrEu18scU2l0mn09fVp+wJAPYgQCCnc8q2DyQafLbb10k10rtDe63jWrTQ2YCEOEx4N01xkp07W8r+Psn9o1ILyVqTf+T1RvyP0XKJF5woG8PRhE1XpciQNnf2u2Y4PYKdOXf89vYRz2Wlt6uLrLoWWQj49PQ3Lstjetm0eKyoqoGkaF3NdXR2nhFJVd/K7IICLQ/dQcjz2czbcQLbNhNcRJCdbnkR942EMfj+Bs9/c0m5+2epSzomip6am2HE+TwS+Lel0GoZhMIB12+aaOHZKiUD2xzuoSui+Y71cQ0zfouQtUJxbvQz/5gq4cOY4rl2/ywDUFIyOjmJ+fj7gXBY1NTVobGwMT0HfwF+IxTWUiq4/ssP4dp2qz1QA1AWUd5KxsbFdby8AUqkUGhoaeEnp4C6QGqAIJHWv+CTcajooIpQWGhcLDj58p8mPwL4BoBSISA0IGKuwTUzLaw6++qTNrwE1BSMjI8jlcg+eAomAWmzilN5a8k/j/LIdiIBahJOTk1hfX3/wIqQaeDRT4YdZwh3WEWtOkQH8fPXOrjYkAFQPruvCcbx2purn1Jomamtrw9tQLUK1+Kjwdq6pMFUA+0JEBODxmoTPA2FvTjopwnNvPY+R8X+4DR+aiokJBQDlXa14AaLWAfHAB6df8AE81MeI2vCxQ0lUPuIx4F6S1L1br9DxnzP3AxGge+WFN3TMLazi08s63zFJSH/mhIOD1Sm8/61395RLLvOAbniMx4WCYqSPER1g6Rx5tmOTvyWfDxl8x/QA2Hi7xWbgH18qY70cbP8HnbEaXWM9SskAAAAASUVORK5CYII="},{"path":"C:\\Users\\simon\\Desktop\\Forgespace 1.15\\Create\\src\\main\\resources\\assets\\create\\textures\\block\\brass_casing.png","name":"brass_casing.png","folder":"block","namespace":"create","id":"1","particle":false,"mode":"bitmap","saved":true,"uuid":"4871ad15-b223-c27e-7677-628b97f293d9","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABeUlEQVQ4T4VSv0/CUBC+J6WkVKUMGn9MSqJNkITEf0MXZTAOxsXB1Tg4Mzu4mejiYuLi/0IiJuiAbhocWojlQQFr7sqjfaUpt9x7vXtfv/vuY1eVkpeFAWBkNIVyNPp8GFu3OANWrZjehmlAebdATe1ve/I+t2JI917X/xFGh/egXmv5ADvlZaje1aiQVVOUlTSD4cCjHA78hnF5WpoGKKzNU3Ho/kmP3JEHaioA+un04fxoGz4aNjDUoGjqcPv0BkuLGcDmpEAgi7twdrgFrw0nALh/foe8phJA23EnYxCjMe2crhITZHByUIDPZj/Q4PrhBbAB48visJrXJCIIKup4RoBW8zcAuHmsSwyw2XF91XU1TWfMYoTj/U0fQGgQHUEAIH08CwZTIyQBhGcQDMgr4xFIg7gtCBG77oh8IbwQHUESMazBrDWKLcSKiI+jxhGAijpHJpPWGNZAWFfsPYmJ5ANjfSHRfXHFrsPAtjmwi71isndnQP8Dd8/5n9T5ysEAAAAASUVORK5CYII="}],"display":{"thirdperson_righthand":{"rotation":[75,45,0],"translation":[0,2.5,0],"scale":[0.375,0.375,0.375]},"thirdperson_lefthand":{"rotation":[75,45,0],"translation":[0,2.5,0],"scale":[0.375,0.375,0.375]},"firstperson_righthand":{"rotation":[0,45,0],"scale":[0.4,0.4,0.4]},"firstperson_lefthand":{"rotation":[0,225,0],"scale":[0.4,0.4,0.4]},"ground":{"translation":[0,3,0],"scale":[0.25,0.25,0.25]},"gui":{"rotation":[30,225,0],"translation":[0,-1.75,0],"scale":[0.45,0.45,0.45]},"head":{"rotation":[-180,0,0],"translation":[0,22.25,0]},"fixed":{"translation":[0,-1.25,0],"scale":[0.5,0.5,0.5]}}} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/portable_storage_interface/portable_storage_interface.png b/src/main/resources/assets/create/models/block/portable_storage_interface/portable_storage_interface.png deleted file mode 100644 index 0e9ade677..000000000 Binary files a/src/main/resources/assets/create/models/block/portable_storage_interface/portable_storage_interface.png and /dev/null differ diff --git a/src/main/resources/assets/create/textures/block/portable_fluid_interface.png b/src/main/resources/assets/create/textures/block/portable_fluid_interface.png new file mode 100644 index 000000000..b0768413a Binary files /dev/null and b/src/main/resources/assets/create/textures/block/portable_fluid_interface.png differ