diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index ca98c85f9..651051293 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -41,7 +41,7 @@ e81608346d43406ee72cae0f78b8bcfb37ba2d75 assets/create/blockstates/brown_seat.js 2ca82a3c4bf7ba1a9cf3bb674e786d9b23b020a4 assets/create/blockstates/chiseled_limestone.json cbcdab42d01f8085db9e5f8db884f8adf7f17625 assets/create/blockstates/chiseled_scoria.json 291952556c52fba2af5bbd793c71af81abd27e71 assets/create/blockstates/chiseled_weathered_limestone.json -99def0a786714a337e2b1b17db844e4d1aee6234 assets/create/blockstates/chute.json +b59324f051f21d8ce1a48a08f4721a61a3c414d6 assets/create/blockstates/chute.json 4947c261310445fa55b92038326ac82967d192dd assets/create/blockstates/clockwork_bearing.json 1f33834c685e3243882acfe20183fe64dfa872be assets/create/blockstates/clutch.json e5e3757e99c139d67b2a70288466d8a74d818841 assets/create/blockstates/cogwheel.json @@ -91,6 +91,7 @@ f63a5816d4bfe643aa098d03c3b54462dd06fe19 assets/create/blockstates/dolomite_cobb f179202e59e449157f89efc37229b03bbfd391d7 assets/create/blockstates/dolomite_pillar.json 7b1c40891b07c8f3238537625d9e25c8627e7333 assets/create/blockstates/encased_belt.json 7b2b836649e729feafa60972bf95e3afb2143131 assets/create/blockstates/encased_fan.json +656813b75dd3b901bf34f24df785e4b0fbe11aa6 assets/create/blockstates/encased_fluid_pipe.json e157d7f67b08493b71d7ffea8d622f4a64dbc155 assets/create/blockstates/encased_shaft.json 1442ff1a0e404f99263ba99d734da1dfed03d4e3 assets/create/blockstates/extractor.json a774e815376a67e2a2de44e39af0a1a0b4406932 assets/create/blockstates/fancy_andesite_bricks.json @@ -129,7 +130,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 e9da1794b6ece7f9aa8bcb43d42c23a55446133b assets/create/blockstates/flywheel.json ac00d40e1ef50a37041c0481afa1a23a14dea78e assets/create/blockstates/framed_glass.json @@ -147,6 +148,7 @@ a64d8d0924c0b5b192f355343dd9b3a440875f6a assets/create/blockstates/gabbro_cobble a6b44e8a1c4ce0c7442b2384b41ad36dd133f19b assets/create/blockstates/gabbro_pillar.json 9c48e311be8b959bfb98e16ffaa358210ac8b9dd assets/create/blockstates/gearbox.json f34814b17cde3231a1dfb271f3dabf8d6de4fbf6 assets/create/blockstates/gearshift.json +93f8bdc22d9a5e04268964e35e4285c8cbf2b89d assets/create/blockstates/glass_fluid_pipe.json 87661d61e1645ef5ad4ea34f1c0fa31f139ea431 assets/create/blockstates/granite_bricks.json d7f4cf7be7e9a3895840d9288245c52cbe25f0bd assets/create/blockstates/granite_bricks_slab.json ec51efc72eb6b16c5f99399b4cb6284665d5be99 assets/create/blockstates/granite_bricks_stairs.json @@ -357,17 +359,17 @@ c77b46d8b459e5c7cc495393546f3fcca8a1fa1d assets/create/blockstates/weathered_lim a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.json 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json -a9bcfd546e95865633a97e4b29e39c4aec940338 assets/create/lang/en_ud.json -aa14daef8d31ca69ace4e643ffdc5cc9aba22818 assets/create/lang/en_us.json -b4435a02a94ae72032f3ffb8f9282e41b1dca953 assets/create/lang/unfinished/de_de.json -4f9cc39db1e0de14e9aeabea93676b8fa8ba58ec assets/create/lang/unfinished/fr_fr.json -a5a1d2d2e6154c07be187dfe2e33c203db1dd678 assets/create/lang/unfinished/it_it.json -022fee71a855d3cd206c2c1d5c36c38f089f8120 assets/create/lang/unfinished/ja_jp.json -07da262b3005fd53abd22b5da558e3494bbefa90 assets/create/lang/unfinished/ko_kr.json -f1a7c021d2a48a56141ffe70ddec7128c5ad7261 assets/create/lang/unfinished/nl_nl.json -5e10814eb0606a6bd20097067394a93842ef7957 assets/create/lang/unfinished/pt_br.json -f1367be00730002ee0f233dfebb5e920eed56900 assets/create/lang/unfinished/ru_ru.json -76928b7d9f7f41f4fa622824a872bec8e5635cea assets/create/lang/unfinished/zh_cn.json +15f8e8f779c6ce41a9e42d87796df14d1415ab5a assets/create/lang/en_ud.json +3c6d8906ded9a78050003f8b029407ef2078da87 assets/create/lang/en_us.json +1abcbe5404e82eb9b944c9075eb39ff3b20512e5 assets/create/lang/unfinished/de_de.json +e9f885ab2cee12075ec10a85e95e2f0a7fc49d9b assets/create/lang/unfinished/fr_fr.json +44331773068529facc64870b0762609567fec8b6 assets/create/lang/unfinished/it_it.json +e3c2ef988da795fc84ea8a9bff8b8557ac6c370a assets/create/lang/unfinished/ja_jp.json +a5c17249f0b2575c372c658bfd958fe4244fb5d6 assets/create/lang/unfinished/ko_kr.json +abcfc0ab1bf1b077f0aeaf54e00c2aceef78d253 assets/create/lang/unfinished/nl_nl.json +899ebaa95bf6d3140bf6bbcf6f8a5fab2ab5111e assets/create/lang/unfinished/pt_br.json +bba218b9d488faf4406d975eba81996f621b2200 assets/create/lang/unfinished/ru_ru.json +b87385232b0be35079736a3a32ff88f252721cf3 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 @@ -544,6 +546,7 @@ cc6d9300cd26f2323c653dbcc61b7a885be8fa3b assets/create/models/block/dolomite_cob a101974d906487326dc38916f828d12a278a49ae assets/create/models/block/dolomite_cobblestone_wall_post.json 9c497140dfe73abe1964479eaf1af8f1892de290 assets/create/models/block/dolomite_cobblestone_wall_side.json 999a7cd79a9dc80c47fd6103b65f006b55187402 assets/create/models/block/dolomite_pillar.json +1a8bac1e97a2a6c3cc362081568d2a7fce815ad5 assets/create/models/block/encased_fluid_pipe.json 17dae5fdc1a551d8ab1ab8a68cabf7a8c3848d86 assets/create/models/block/fancy_andesite_bricks.json cfb2cd84a1cbd9226a77ebc1f6c29e8eaa9c577f assets/create/models/block/fancy_andesite_bricks_slab.json 8ee27601996ab577991b6a0f7e9df27db0282cad assets/create/models/block/fancy_andesite_bricks_slab_top.json @@ -1441,6 +1444,14 @@ a135eec618e448f440d9f42cc7a3e6c63fc45a71 data/create/advancements/overstressed.j 1e3cd82e36fd4bcd053d652a0eead4458ed7f315 data/create/advancements/press.json b2782692d27ffb105e3167174cebe1ebdd4a9867 data/create/advancements/recipes/create.base/brass_block.json df6f220e693f5256bb3df8d6c7769bc931820ae5 data/create/advancements/recipes/create.base/copper_block.json +dbe67196168805a5903aa29de7631d33329060d1 data/create/advancements/recipes/create.base/crafting_shaped/schematics/schematic_table.json +0c5badff77b751b086b0da5943bea186256668cb data/create/advancements/recipes/create.base/crafting_shaped/schematics/schematicannon.json +c2ff86e360002e714877060540378940b8d72c4b data/create/advancements/recipes/create.base/crafting_shapeless/appliances/dough.json +b77cfa58f80d92299ea628b361bd42d462517d13 data/create/advancements/recipes/create.base/crafting_shapeless/materials/red_sand_paper.json +cbbd15261cbb270237347cf00246a6b4045e5ce0 data/create/advancements/recipes/create.base/crafting_shapeless/materials/rose_quartz.json +aaea2ee62bb7888e83fcc282c87bc6cb970d30ec data/create/advancements/recipes/create.base/crafting_shapeless/materials/sand_paper.json +f6b8aa96169d3857c31d8a087ca1dd6b5077defc data/create/advancements/recipes/create.base/crafting_shapeless/schematics/empty_schematic.json +e53989fa8a2742b55226e4af040ae3a98cc07994 data/create/advancements/recipes/create.base/crafting_shapeless/schematics/schematic_and_quill.json 82280c50b78dd7e8c179cb8e8f0c074b26ec9586 data/create/advancements/recipes/create.base/zinc_block.json 909345eb2f5541a2be592a52800319a8765ca345 data/create/advancements/recipes/create.palettes/acacia_window.json 73f99cd857b056da5e19ff8304a4f5eeacc4f8cd data/create/advancements/recipes/create.palettes/acacia_window_pane.json @@ -1815,6 +1826,8 @@ b77c5aecd0b6dd37a0c69431ab7a4a40fe0770eb data/create/advancements/recipes/create e548127075559307b767b802f4809ed52eedd543 data/create/advancements/recipes/create.palettes/weathered_limestone_cobblestone_wall_from_weathered_limestone_cobblestone_stonecutting.json 23ba836640a4d543db6f1cb72cc86a6543fe2fbe data/create/advancements/recipes/create.palettes/weathered_limestone_pillar.json 9790a16fd56e47cb5abbfad4062672303c224d9f data/create/advancements/recipes/create.palettes/weathered_limestone_pillar_from_weathered_limestone_stonecutting.json +731da8361ecf00e2280a269e15cee00195d70bd7 data/create/advancements/recipes/food/crafting_shaped/appliances/cake.json +fc2411c0f4a4da43f6f213fc3bfffd35e6ad3775 data/create/advancements/recipes/misc/crafting_shapeless/appliances/slime_ball.json e0b9edc5e59647e7dd99be17369b263dadf407d4 data/create/advancements/refined_radiance.json fc12b590ab8f5ac901db21c67ba3850f157e1421 data/create/advancements/root.json 8529fc7919b6a3240ede2bb8043906bb72fb7f9e data/create/advancements/shadow_end.json @@ -1920,6 +1933,7 @@ d5fc5b3dc612cd748117e9d8b0ecda76e73f4514 data/create/loot_tables/blocks/dolomite 6121c99e6e037dda9022af3a414aee444467ac1b data/create/loot_tables/blocks/dolomite_pillar.json 503a93787537b46f462d32b0382c3396f42bb1f6 data/create/loot_tables/blocks/encased_belt.json 9055d82b983b673e1638d17b712b9fcd1f5a52e6 data/create/loot_tables/blocks/encased_fan.json +c8aa9bbed8fd703eb1853de0b7c9e04dffb7a511 data/create/loot_tables/blocks/encased_fluid_pipe.json b127cb6920e6d7d9c8b2402cb186402a9a8dd3fc data/create/loot_tables/blocks/encased_shaft.json 5a47c1535c866184b4ffca65763f5676f319e0aa data/create/loot_tables/blocks/extractor.json ddfc4764a6039d771e03af815ac4493da80d2e6b data/create/loot_tables/blocks/fancy_andesite_bricks.json @@ -1976,6 +1990,7 @@ ae19749df10663efc51b8b27af310164f250ed38 data/create/loot_tables/blocks/gabbro_c e8d09c919e3b8125d7da0f38383c01bcfc61c7a8 data/create/loot_tables/blocks/gabbro_pillar.json b0109b4a4f0f738cbbe6b5911e8c3c0310b76f99 data/create/loot_tables/blocks/gearbox.json 5f39461c5c9d3ad8d84195b06b9468fe2b0fb269 data/create/loot_tables/blocks/gearshift.json +c8aa9bbed8fd703eb1853de0b7c9e04dffb7a511 data/create/loot_tables/blocks/glass_fluid_pipe.json 74371bc2b516ad9742ca081d82dc1b7f642e25b4 data/create/loot_tables/blocks/granite_bricks.json 29f2cbc04f898bb8ff48055a7e43ded85e635bf9 data/create/loot_tables/blocks/granite_bricks_slab.json 6b2c74992f261df4f539ff65919e2f4a58b146ec data/create/loot_tables/blocks/granite_bricks_stairs.json @@ -2214,6 +2229,16 @@ c323b106e88b7de77fea71ff12494abdbb818d15 data/create/recipes/chiseled_limestone_ da9a919b476954c1de34826aa7706bf6056a8f12 data/create/recipes/chiseled_scoria_from_scoria_stonecutting.json 09faa4ddcf9f3907dcdb3ab3e8b68c1deb2486e5 data/create/recipes/chiseled_weathered_limestone_from_weathered_limestone_stonecutting.json 386c52f0aad6e2239f31dc85f7e745b47230846b data/create/recipes/copper_block.json +d19b3fa4bedacedf0c57aecba5a7e025e5a6b032 data/create/recipes/crafting_shaped/appliances/cake.json +5a7ee5951c15db03a4e38f5cbc1833f3d889e2b1 data/create/recipes/crafting_shaped/schematics/schematic_table.json +50cffa44fb016b856629538cb0be52c162139ec5 data/create/recipes/crafting_shaped/schematics/schematicannon.json +19526da3a59fc136654ff1bc93c0251581f397a9 data/create/recipes/crafting_shapeless/appliances/dough.json +7b5f863dda3d05a79cb85943a178eba0bd8a7dc7 data/create/recipes/crafting_shapeless/appliances/slime_ball.json +9c9e40ffd41ce46c65113080a92ff9b4f27e5fab data/create/recipes/crafting_shapeless/materials/red_sand_paper.json +7eb292bc564de70227f4bf947050bcdbfc5a8d67 data/create/recipes/crafting_shapeless/materials/rose_quartz.json +5ca47ec1bca9a5ce28aabd9868b74b71c829ca07 data/create/recipes/crafting_shapeless/materials/sand_paper.json +0b7acc249bed992387aa9702a2c05836ecf584df data/create/recipes/crafting_shapeless/schematics/empty_schematic.json +5c47ac2e2b596439a684126fef7265f13de2379b data/create/recipes/crafting_shapeless/schematics/schematic_and_quill.json f2c317e03ac4d42fb631e1625607061e10c480fe data/create/recipes/dark_oak_window.json d9dbae6e237eb38e53a619a0f1b339fca7c59b4d data/create/recipes/dark_oak_window_pane.json 55596a590962e3ddd40949917661f0bd94408274 data/create/recipes/dark_scoria_bricks_from_dark_scoria_stonecutting.json diff --git a/src/generated/resources/assets/create/blockstates/chute.json b/src/generated/resources/assets/create/blockstates/chute.json index b976d52b6..3e82ef8a8 100644 --- a/src/generated/resources/assets/create/blockstates/chute.json +++ b/src/generated/resources/assets/create/blockstates/chute.json @@ -1,39 +1,39 @@ { "variants": { - "facing=down,shape=start": { - "model": "create:block/chute/block_windowed" + "facing=down,shape=intersection": { + "model": "create:block/chute/block_intersection" }, - "facing=north,shape=start": { - "model": "create:block/chute/block_diagonal_start", + "facing=north,shape=intersection": { + "model": "create:block/chute/block_diagonal_intersection", "y": 180 }, - "facing=south,shape=start": { - "model": "create:block/chute/block_diagonal_start" + "facing=south,shape=intersection": { + "model": "create:block/chute/block_diagonal_intersection" }, - "facing=west,shape=start": { - "model": "create:block/chute/block_diagonal_start", + "facing=west,shape=intersection": { + "model": "create:block/chute/block_diagonal_intersection", "y": 90 }, - "facing=east,shape=start": { - "model": "create:block/chute/block_diagonal_start", + "facing=east,shape=intersection": { + "model": "create:block/chute/block_diagonal_intersection", "y": 270 }, - "facing=down,shape=window_straight": { + "facing=down,shape=window": { "model": "create:block/chute/block_windowed" }, - "facing=north,shape=window_straight": { - "model": "create:block/chute/block_diagonal_straight", + "facing=north,shape=window": { + "model": "create:block/chute/block_diagonal", "y": 180 }, - "facing=south,shape=window_straight": { - "model": "create:block/chute/block_diagonal_straight" + "facing=south,shape=window": { + "model": "create:block/chute/block_diagonal" }, - "facing=west,shape=window_straight": { - "model": "create:block/chute/block_diagonal_straight", + "facing=west,shape=window": { + "model": "create:block/chute/block_diagonal", "y": 90 }, - "facing=east,shape=window_straight": { - "model": "create:block/chute/block_diagonal_straight", + "facing=east,shape=window": { + "model": "create:block/chute/block_diagonal", "y": 270 }, "facing=down,shape=normal": { diff --git a/src/generated/resources/assets/create/blockstates/encased_fluid_pipe.json b/src/generated/resources/assets/create/blockstates/encased_fluid_pipe.json new file mode 100644 index 000000000..129e39baa --- /dev/null +++ b/src/generated/resources/assets/create/blockstates/encased_fluid_pipe.json @@ -0,0 +1,17 @@ +{ + "variants": { + "axis=x": { + "model": "create:block/encased_fluid_pipe", + "x": 90, + "y": 90 + }, + "axis=y": { + "model": "create:block/encased_fluid_pipe" + }, + "axis=z": { + "model": "create:block/encased_fluid_pipe", + "x": 90, + "y": 180 + } + } +} \ No newline at end of file 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/glass_fluid_pipe.json b/src/generated/resources/assets/create/blockstates/glass_fluid_pipe.json new file mode 100644 index 000000000..190223a77 --- /dev/null +++ b/src/generated/resources/assets/create/blockstates/glass_fluid_pipe.json @@ -0,0 +1,30 @@ +{ + "variants": { + "alt=false,axis=x": { + "model": "create:block/fluid_pipe/window", + "x": 90, + "y": 90 + }, + "alt=true,axis=x": { + "model": "create:block/fluid_pipe/window_alt", + "x": 90, + "y": 90 + }, + "alt=false,axis=y": { + "model": "create:block/fluid_pipe/window" + }, + "alt=true,axis=y": { + "model": "create:block/fluid_pipe/window_alt" + }, + "alt=false,axis=z": { + "model": "create:block/fluid_pipe/window", + "x": 90, + "y": 180 + }, + "alt=true,axis=z": { + "model": "create:block/fluid_pipe/window_alt", + "x": 90, + "y": 180 + } + } +} \ 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 c7193b404..b8b2bea9a 100644 --- a/src/generated/resources/assets/create/lang/en_ud.json +++ b/src/generated/resources/assets/create/lang/en_ud.json @@ -92,6 +92,7 @@ "block.create.dolomite_pillar": "\u0279\u0250\u05DF\u05DF\u0131\u0500 \u01DD\u0287\u0131\u026Fo\u05DFo\u15E1", "block.create.encased_belt": "\u0287\u05DF\u01DD\u15FA p\u01DDs\u0250\u0254u\u018E", "block.create.encased_fan": "u\u0250\u2132 p\u01DDs\u0250\u0254u\u018E", + "block.create.encased_fluid_pipe": "\u01DDd\u0131\u0500 p\u0131n\u05DF\u2132 p\u01DDs\u0250\u0254u\u018E", "block.create.encased_shaft": "\u0287\u025F\u0250\u0265S p\u01DDs\u0250\u0254u\u018E", "block.create.extractor": "\u0279o\u0287\u0254\u0250\u0279\u0287x\u018E", "block.create.fancy_andesite_bricks": "s\u029E\u0254\u0131\u0279\u15FA \u01DD\u0287\u0131s\u01DDpu\u2C6F \u028E\u0254u\u0250\u2132", @@ -148,6 +149,7 @@ "block.create.gabbro_pillar": "\u0279\u0250\u05DF\u05DF\u0131\u0500 o\u0279qq\u0250\u2141", "block.create.gearbox": "xoq\u0279\u0250\u01DD\u2141", "block.create.gearshift": "\u0287\u025F\u0131\u0265s\u0279\u0250\u01DD\u2141", + "block.create.glass_fluid_pipe": "\u01DDd\u0131\u0500 p\u0131n\u05DF\u2132 ss\u0250\u05DF\u2141", "block.create.granite_bricks": "s\u029E\u0254\u0131\u0279\u15FA \u01DD\u0287\u0131u\u0250\u0279\u2141", "block.create.granite_bricks_slab": "q\u0250\u05DFS s\u029E\u0254\u0131\u0279\u15FA \u01DD\u0287\u0131u\u0250\u0279\u2141", "block.create.granite_bricks_stairs": "s\u0279\u0131\u0250\u0287S s\u029E\u0254\u0131\u0279\u15FA \u01DD\u0287\u0131u\u0250\u0279\u2141", diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index e2b28974a..3e1f93730 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -95,6 +95,7 @@ "block.create.dolomite_pillar": "Dolomite Pillar", "block.create.encased_belt": "Encased Belt", "block.create.encased_fan": "Encased Fan", + "block.create.encased_fluid_pipe": "Encased Fluid Pipe", "block.create.encased_shaft": "Encased Shaft", "block.create.extractor": "Extractor", "block.create.fancy_andesite_bricks": "Fancy Andesite Bricks", @@ -151,6 +152,7 @@ "block.create.gabbro_pillar": "Gabbro Pillar", "block.create.gearbox": "Gearbox", "block.create.gearshift": "Gearshift", + "block.create.glass_fluid_pipe": "Glass Fluid Pipe", "block.create.granite_bricks": "Granite Bricks", "block.create.granite_bricks_slab": "Granite Bricks Slab", "block.create.granite_bricks_stairs": "Granite Bricks Stairs", @@ -462,7 +464,7 @@ "advancement.create.electron_tube": "Beep boop", "advancement.create.electron_tube.desc": "Make some Electron Tubes, useful in crafting less primitive machinery.", "advancement.create.mechanical_saw": "Stationary Chopping", - "advancement.create.mechanical_saw.desc": "Place and power a Mechanical mechanical_saw", + "advancement.create.mechanical_saw.desc": "Place and power a Mechanical Saw", "advancement.create.basin": "Basin Operation", "advancement.create.basin.desc": "Place a basin and try throwing items into it.", "advancement.create.mixer": "Mixin' it Up", @@ -520,7 +522,7 @@ "death.attack.create.fan_fire": "%1$s was burned to death by hot air", "death.attack.create.fan_lava": "%1$s was burned to death by lava fan", "death.attack.create.mechanical_drill": "%1$s was impaled by Mechanical mechanical_drill", - "death.attack.create.mechanical_saw": "%1$s got cut in half by Mechanical mechanical_saw", + "death.attack.create.mechanical_saw": "%1$s got cut in half by Mechanical Saw", "death.attack.create.cuckoo_clock_explosion": "%1$s was blown up by tampered cuckoo clock", "create.block.deployer.damage_source_name": "a rogue Deployer", @@ -537,7 +539,7 @@ "create.recipe.pressing": "Pressing", "create.recipe.mixing": "Mixing", "create.recipe.packing": "Compacting", - "create.recipe.mechanical_sawing": "mechanical_sawing", + "create.recipe.mechanical_sawing": "Sawing", "create.recipe.mechanical_crafting": "Mechanical Crafting", "create.recipe.block_cutting": "Block Cutting", "create.recipe.blockzapper_upgrade": "Handheld Blockzapper", 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 107a02e1e..d97957a10 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: 814", + "_": "Missing Localizations: 816", "_": "->------------------------] Game Elements [------------------------<-", @@ -96,6 +96,7 @@ "block.create.dolomite_pillar": "Dolomitsäule", "block.create.encased_belt": "Eingeschlossener Riemen", "block.create.encased_fan": "Eingeschlossener Propeller", + "block.create.encased_fluid_pipe": "UNLOCALIZED: Encased Fluid Pipe", "block.create.encased_shaft": "Eingeschlossene Welle", "block.create.extractor": "Auswerfer", "block.create.fancy_andesite_bricks": "UNLOCALIZED: Fancy Andesite Bricks", @@ -152,6 +153,7 @@ "block.create.gabbro_pillar": "UNLOCALIZED: Gabbro Pillar", "block.create.gearbox": "Getriebe", "block.create.gearshift": "Gangschaltung", + "block.create.glass_fluid_pipe": "UNLOCALIZED: Glass Fluid Pipe", "block.create.granite_bricks": "Granitziegel", "block.create.granite_bricks_slab": "UNLOCALIZED: Granite Bricks Slab", "block.create.granite_bricks_stairs": "UNLOCALIZED: Granite Bricks Stairs", @@ -463,7 +465,7 @@ "advancement.create.electron_tube": "UNLOCALIZED: Beep boop", "advancement.create.electron_tube.desc": "UNLOCALIZED: Make some Electron Tubes, useful in crafting less primitive machinery.", "advancement.create.mechanical_saw": "UNLOCALIZED: Stationary Chopping", - "advancement.create.mechanical_saw.desc": "UNLOCALIZED: Place and power a Mechanical mechanical_saw", + "advancement.create.mechanical_saw.desc": "UNLOCALIZED: Place and power a Mechanical Saw", "advancement.create.basin": "UNLOCALIZED: Basin Operation", "advancement.create.basin.desc": "UNLOCALIZED: Place a basin and try throwing items into it.", "advancement.create.mixer": "UNLOCALIZED: Mixin' it Up", @@ -521,7 +523,7 @@ "death.attack.create.fan_fire": "%1$s hat heiße Luft eingeatmet", "death.attack.create.fan_lava": "%1$s wurde von Lava verweht", "death.attack.create.mechanical_drill": "%1$s wurde von einem Bohrer durchlöchert", - "death.attack.create.mechanical_saw": "UNLOCALIZED: %1$s got cut in half by Mechanical mechanical_saw", + "death.attack.create.mechanical_saw": "UNLOCALIZED: %1$s got cut in half by Mechanical Saw", "death.attack.create.cuckoo_clock_explosion": "UNLOCALIZED: %1$s was blown up by tampered cuckoo clock", "create.block.deployer.damage_source_name": "UNLOCALIZED: a rogue Deployer", @@ -538,7 +540,7 @@ "create.recipe.pressing": "Mechanische Presse", "create.recipe.mixing": "UNLOCALIZED: Mixing", "create.recipe.packing": "UNLOCALIZED: Compacting", - "create.recipe.mechanical_sawing": "UNLOCALIZED: mechanical_sawing", + "create.recipe.mechanical_sawing": "UNLOCALIZED: Sawing", "create.recipe.mechanical_crafting": "UNLOCALIZED: Mechanical Crafting", "create.recipe.block_cutting": "UNLOCALIZED: Block Cutting", "create.recipe.blockzapper_upgrade": "Blockpistole", 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 484c243b7..cc5d96a42 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: 417", + "_": "Missing Localizations: 419", "_": "->------------------------] Game Elements [------------------------<-", @@ -96,6 +96,7 @@ "block.create.dolomite_pillar": "Pillier de dolomie", "block.create.encased_belt": "Tapis roulant enfermé", "block.create.encased_fan": "Ventilateur enfermé", + "block.create.encased_fluid_pipe": "UNLOCALIZED: Encased Fluid Pipe", "block.create.encased_shaft": "Arbre mécanique enfermé", "block.create.extractor": "Extracteur", "block.create.fancy_andesite_bricks": "UNLOCALIZED: Fancy Andesite Bricks", @@ -152,6 +153,7 @@ "block.create.gabbro_pillar": "UNLOCALIZED: Gabbro Pillar", "block.create.gearbox": "Boîte à roue dentée", "block.create.gearshift": "Décaleur de rotation", + "block.create.glass_fluid_pipe": "UNLOCALIZED: Glass Fluid Pipe", "block.create.granite_bricks": "Briques de granite", "block.create.granite_bricks_slab": "UNLOCALIZED: Granite Bricks Slab", "block.create.granite_bricks_stairs": "UNLOCALIZED: Granite Bricks Stairs", @@ -463,7 +465,7 @@ "advancement.create.electron_tube": "UNLOCALIZED: Beep boop", "advancement.create.electron_tube.desc": "UNLOCALIZED: Make some Electron Tubes, useful in crafting less primitive machinery.", "advancement.create.mechanical_saw": "UNLOCALIZED: Stationary Chopping", - "advancement.create.mechanical_saw.desc": "UNLOCALIZED: Place and power a Mechanical mechanical_saw", + "advancement.create.mechanical_saw.desc": "UNLOCALIZED: Place and power a Mechanical Saw", "advancement.create.basin": "UNLOCALIZED: Basin Operation", "advancement.create.basin.desc": "UNLOCALIZED: Place a basin and try throwing items into it.", "advancement.create.mixer": "UNLOCALIZED: Mixin' it Up", 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 ae1d277e1..0cbe83a50 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: 401", + "_": "Missing Localizations: 403", "_": "->------------------------] Game Elements [------------------------<-", @@ -96,6 +96,7 @@ "block.create.dolomite_pillar": "Pilastro di Dolomite", "block.create.encased_belt": "Nastro Incassato", "block.create.encased_fan": "Ventilatore incassato", + "block.create.encased_fluid_pipe": "UNLOCALIZED: Encased Fluid Pipe", "block.create.encased_shaft": "Albero Incassato", "block.create.extractor": "Estrattore", "block.create.fancy_andesite_bricks": "UNLOCALIZED: Fancy Andesite Bricks", @@ -152,6 +153,7 @@ "block.create.gabbro_pillar": "UNLOCALIZED: Gabbro Pillar", "block.create.gearbox": "Riduttore", "block.create.gearshift": "Cambio", + "block.create.glass_fluid_pipe": "UNLOCALIZED: Glass Fluid Pipe", "block.create.granite_bricks": "Mattoni di Granito", "block.create.granite_bricks_slab": "UNLOCALIZED: Granite Bricks Slab", "block.create.granite_bricks_stairs": "UNLOCALIZED: Granite Bricks Stairs", @@ -463,7 +465,7 @@ "advancement.create.electron_tube": "UNLOCALIZED: Beep boop", "advancement.create.electron_tube.desc": "UNLOCALIZED: Make some Electron Tubes, useful in crafting less primitive machinery.", "advancement.create.mechanical_saw": "UNLOCALIZED: Stationary Chopping", - "advancement.create.mechanical_saw.desc": "UNLOCALIZED: Place and power a Mechanical mechanical_saw", + "advancement.create.mechanical_saw.desc": "UNLOCALIZED: Place and power a Mechanical Saw", "advancement.create.basin": "UNLOCALIZED: Basin Operation", "advancement.create.basin.desc": "UNLOCALIZED: Place a basin and try throwing items into it.", "advancement.create.mixer": "UNLOCALIZED: Mixin' it Up", 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 c32b645d8..e7f17c4b3 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: 396", + "_": "Missing Localizations: 398", "_": "->------------------------] Game Elements [------------------------<-", @@ -96,6 +96,7 @@ "block.create.dolomite_pillar": "苦灰石の柱", "block.create.encased_belt": "ケース入りベルト", "block.create.encased_fan": "ケース入りファン", + "block.create.encased_fluid_pipe": "UNLOCALIZED: Encased Fluid Pipe", "block.create.encased_shaft": "ケース入りシャフト", "block.create.extractor": "エクストラクター", "block.create.fancy_andesite_bricks": "UNLOCALIZED: Fancy Andesite Bricks", @@ -152,6 +153,7 @@ "block.create.gabbro_pillar": "UNLOCALIZED: Gabbro Pillar", "block.create.gearbox": "ギアボックス", "block.create.gearshift": "ギアシフト", + "block.create.glass_fluid_pipe": "UNLOCALIZED: Glass Fluid Pipe", "block.create.granite_bricks": "花崗岩レンガ", "block.create.granite_bricks_slab": "UNLOCALIZED: Granite Bricks Slab", "block.create.granite_bricks_stairs": "UNLOCALIZED: Granite Bricks Stairs", @@ -463,7 +465,7 @@ "advancement.create.electron_tube": "UNLOCALIZED: Beep boop", "advancement.create.electron_tube.desc": "UNLOCALIZED: Make some Electron Tubes, useful in crafting less primitive machinery.", "advancement.create.mechanical_saw": "UNLOCALIZED: Stationary Chopping", - "advancement.create.mechanical_saw.desc": "UNLOCALIZED: Place and power a Mechanical mechanical_saw", + "advancement.create.mechanical_saw.desc": "UNLOCALIZED: Place and power a Mechanical Saw", "advancement.create.basin": "UNLOCALIZED: Basin Operation", "advancement.create.basin.desc": "UNLOCALIZED: Place a basin and try throwing items into it.", "advancement.create.mixer": "UNLOCALIZED: Mixin' it Up", 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 987f35f24..0ea3b551d 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: 401", + "_": "Missing Localizations: 403", "_": "->------------------------] Game Elements [------------------------<-", @@ -96,6 +96,7 @@ "block.create.dolomite_pillar": "백운암 기둥", "block.create.encased_belt": "덮힌 벨트", "block.create.encased_fan": "덮힌 환풍기", + "block.create.encased_fluid_pipe": "UNLOCALIZED: Encased Fluid Pipe", "block.create.encased_shaft": "덮힌 축", "block.create.extractor": "추출기", "block.create.fancy_andesite_bricks": "UNLOCALIZED: Fancy Andesite Bricks", @@ -152,6 +153,7 @@ "block.create.gabbro_pillar": "UNLOCALIZED: Gabbro Pillar", "block.create.gearbox": "기어박스", "block.create.gearshift": "기어쉬프트", + "block.create.glass_fluid_pipe": "UNLOCALIZED: Glass Fluid Pipe", "block.create.granite_bricks": "화강암 벽돌", "block.create.granite_bricks_slab": "UNLOCALIZED: Granite Bricks Slab", "block.create.granite_bricks_stairs": "UNLOCALIZED: Granite Bricks Stairs", @@ -463,7 +465,7 @@ "advancement.create.electron_tube": "UNLOCALIZED: Beep boop", "advancement.create.electron_tube.desc": "UNLOCALIZED: Make some Electron Tubes, useful in crafting less primitive machinery.", "advancement.create.mechanical_saw": "UNLOCALIZED: Stationary Chopping", - "advancement.create.mechanical_saw.desc": "UNLOCALIZED: Place and power a Mechanical mechanical_saw", + "advancement.create.mechanical_saw.desc": "UNLOCALIZED: Place and power a Mechanical Saw", "advancement.create.basin": "UNLOCALIZED: Basin Operation", "advancement.create.basin.desc": "UNLOCALIZED: Place a basin and try throwing items into it.", "advancement.create.mixer": "UNLOCALIZED: Mixin' it Up", 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 e25f63bb0..4ede6062f 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: 751", + "_": "Missing Localizations: 753", "_": "->------------------------] Game Elements [------------------------<-", @@ -96,6 +96,7 @@ "block.create.dolomite_pillar": "Dolomiet Pilaar", "block.create.encased_belt": "Omhulsde Transportband", "block.create.encased_fan": "Omhulsde Ventilator", + "block.create.encased_fluid_pipe": "UNLOCALIZED: Encased Fluid Pipe", "block.create.encased_shaft": "Omhulsde Drijfas", "block.create.extractor": "Extractor", "block.create.fancy_andesite_bricks": "UNLOCALIZED: Fancy Andesite Bricks", @@ -152,6 +153,7 @@ "block.create.gabbro_pillar": "UNLOCALIZED: Gabbro Pillar", "block.create.gearbox": "Versnellingsbak", "block.create.gearshift": "Versnellingspook", + "block.create.glass_fluid_pipe": "UNLOCALIZED: Glass Fluid Pipe", "block.create.granite_bricks": "Granietstenen", "block.create.granite_bricks_slab": "UNLOCALIZED: Granite Bricks Slab", "block.create.granite_bricks_stairs": "UNLOCALIZED: Granite Bricks Stairs", @@ -463,7 +465,7 @@ "advancement.create.electron_tube": "UNLOCALIZED: Beep boop", "advancement.create.electron_tube.desc": "UNLOCALIZED: Make some Electron Tubes, useful in crafting less primitive machinery.", "advancement.create.mechanical_saw": "UNLOCALIZED: Stationary Chopping", - "advancement.create.mechanical_saw.desc": "UNLOCALIZED: Place and power a Mechanical mechanical_saw", + "advancement.create.mechanical_saw.desc": "UNLOCALIZED: Place and power a Mechanical Saw", "advancement.create.basin": "UNLOCALIZED: Basin Operation", "advancement.create.basin.desc": "UNLOCALIZED: Place a basin and try throwing items into it.", "advancement.create.mixer": "UNLOCALIZED: Mixin' it Up", @@ -521,7 +523,7 @@ "death.attack.create.fan_fire": "%1$s is verbrand door hete lucht", "death.attack.create.fan_lava": "%1$s is verbrand door een lava ventilator", "death.attack.create.mechanical_drill": "%1$s is gespietst door een mechanische boor", - "death.attack.create.mechanical_saw": "UNLOCALIZED: %1$s got cut in half by Mechanical mechanical_saw", + "death.attack.create.mechanical_saw": "UNLOCALIZED: %1$s got cut in half by Mechanical Saw", "death.attack.create.cuckoo_clock_explosion": "UNLOCALIZED: %1$s was blown up by tampered cuckoo clock", "create.block.deployer.damage_source_name": "UNLOCALIZED: a rogue Deployer", 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 b58961752..142638abd 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: 821", + "_": "Missing Localizations: 823", "_": "->------------------------] Game Elements [------------------------<-", @@ -96,6 +96,7 @@ "block.create.dolomite_pillar": "Pilar de Dolomite", "block.create.encased_belt": "Esteira Revestida", "block.create.encased_fan": "Ventilador Revestida", + "block.create.encased_fluid_pipe": "UNLOCALIZED: Encased Fluid Pipe", "block.create.encased_shaft": "Eixo Revestido", "block.create.extractor": "Extrator", "block.create.fancy_andesite_bricks": "UNLOCALIZED: Fancy Andesite Bricks", @@ -152,6 +153,7 @@ "block.create.gabbro_pillar": "UNLOCALIZED: Gabbro Pillar", "block.create.gearbox": "Caixa de Transmissão", "block.create.gearshift": "Câmbio", + "block.create.glass_fluid_pipe": "UNLOCALIZED: Glass Fluid Pipe", "block.create.granite_bricks": "Tijolos de Granito", "block.create.granite_bricks_slab": "UNLOCALIZED: Granite Bricks Slab", "block.create.granite_bricks_stairs": "UNLOCALIZED: Granite Bricks Stairs", @@ -463,7 +465,7 @@ "advancement.create.electron_tube": "UNLOCALIZED: Beep boop", "advancement.create.electron_tube.desc": "UNLOCALIZED: Make some Electron Tubes, useful in crafting less primitive machinery.", "advancement.create.mechanical_saw": "UNLOCALIZED: Stationary Chopping", - "advancement.create.mechanical_saw.desc": "UNLOCALIZED: Place and power a Mechanical mechanical_saw", + "advancement.create.mechanical_saw.desc": "UNLOCALIZED: Place and power a Mechanical Saw", "advancement.create.basin": "UNLOCALIZED: Basin Operation", "advancement.create.basin.desc": "UNLOCALIZED: Place a basin and try throwing items into it.", "advancement.create.mixer": "UNLOCALIZED: Mixin' it Up", @@ -521,7 +523,7 @@ "death.attack.create.fan_fire": "%1$s foi queimado por ar quente", "death.attack.create.fan_lava": "%1$s foi queimado pelo ventilador de lava", "death.attack.create.mechanical_drill": "%1$s foi empalado pela Furadeira Mecânica", - "death.attack.create.mechanical_saw": "UNLOCALIZED: %1$s got cut in half by Mechanical mechanical_saw", + "death.attack.create.mechanical_saw": "UNLOCALIZED: %1$s got cut in half by Mechanical Saw", "death.attack.create.cuckoo_clock_explosion": "UNLOCALIZED: %1$s was blown up by tampered cuckoo clock", "create.block.deployer.damage_source_name": "UNLOCALIZED: a rogue Deployer", @@ -538,7 +540,7 @@ "create.recipe.pressing": "Prensa Mecânica", "create.recipe.mixing": "UNLOCALIZED: Mixing", "create.recipe.packing": "UNLOCALIZED: Compacting", - "create.recipe.mechanical_sawing": "UNLOCALIZED: mechanical_sawing", + "create.recipe.mechanical_sawing": "UNLOCALIZED: Sawing", "create.recipe.mechanical_crafting": "UNLOCALIZED: Mechanical Crafting", "create.recipe.block_cutting": "UNLOCALIZED: Block Cutting", "create.recipe.blockzapper_upgrade": "Blockzapper Portátil", 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 c0713565b..f00860aa7 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: 815", + "_": "Missing Localizations: 817", "_": "->------------------------] Game Elements [------------------------<-", @@ -96,6 +96,7 @@ "block.create.dolomite_pillar": "Доломитовая колонна", "block.create.encased_belt": "Ленточный привод", "block.create.encased_fan": "Вентилятор", + "block.create.encased_fluid_pipe": "UNLOCALIZED: Encased Fluid Pipe", "block.create.encased_shaft": "Вальный привод", "block.create.extractor": "Экстрактор", "block.create.fancy_andesite_bricks": "UNLOCALIZED: Fancy Andesite Bricks", @@ -152,6 +153,7 @@ "block.create.gabbro_pillar": "UNLOCALIZED: Gabbro Pillar", "block.create.gearbox": "Муфта", "block.create.gearshift": "Реверсивная муфта", + "block.create.glass_fluid_pipe": "UNLOCALIZED: Glass Fluid Pipe", "block.create.granite_bricks": "Гранитные кирпичи", "block.create.granite_bricks_slab": "UNLOCALIZED: Granite Bricks Slab", "block.create.granite_bricks_stairs": "UNLOCALIZED: Granite Bricks Stairs", @@ -463,7 +465,7 @@ "advancement.create.electron_tube": "UNLOCALIZED: Beep boop", "advancement.create.electron_tube.desc": "UNLOCALIZED: Make some Electron Tubes, useful in crafting less primitive machinery.", "advancement.create.mechanical_saw": "UNLOCALIZED: Stationary Chopping", - "advancement.create.mechanical_saw.desc": "UNLOCALIZED: Place and power a Mechanical mechanical_saw", + "advancement.create.mechanical_saw.desc": "UNLOCALIZED: Place and power a Mechanical Saw", "advancement.create.basin": "UNLOCALIZED: Basin Operation", "advancement.create.basin.desc": "UNLOCALIZED: Place a basin and try throwing items into it.", "advancement.create.mixer": "UNLOCALIZED: Mixin' it Up", @@ -521,7 +523,7 @@ "death.attack.create.fan_fire": "%1$s сгорел заживо от горячего воздуха.", "death.attack.create.fan_lava": "%1$s сгорел заживо от лавового вентилятора", "death.attack.create.mechanical_drill": "%1$s был проколот механическим буром", - "death.attack.create.mechanical_saw": "UNLOCALIZED: %1$s got cut in half by Mechanical mechanical_saw", + "death.attack.create.mechanical_saw": "UNLOCALIZED: %1$s got cut in half by Mechanical Saw", "death.attack.create.cuckoo_clock_explosion": "UNLOCALIZED: %1$s was blown up by tampered cuckoo clock", "create.block.deployer.damage_source_name": "UNLOCALIZED: a rogue Deployer", @@ -538,7 +540,7 @@ "create.recipe.pressing": "Механический пресс", "create.recipe.mixing": "UNLOCALIZED: Mixing", "create.recipe.packing": "UNLOCALIZED: Compacting", - "create.recipe.mechanical_sawing": "UNLOCALIZED: mechanical_sawing", + "create.recipe.mechanical_sawing": "UNLOCALIZED: Sawing", "create.recipe.mechanical_crafting": "UNLOCALIZED: Mechanical Crafting", "create.recipe.block_cutting": "UNLOCALIZED: Block Cutting", "create.recipe.blockzapper_upgrade": "Портативный размещатель блоков", 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 7a67ca10c..f52c5c6d9 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: 77", + "_": "Missing Localizations: 79", "_": "->------------------------] Game Elements [------------------------<-", @@ -96,6 +96,7 @@ "block.create.dolomite_pillar": "竖纹白云岩", "block.create.encased_belt": "连携齿轮箱", "block.create.encased_fan": "鼓风机", + "block.create.encased_fluid_pipe": "UNLOCALIZED: Encased Fluid Pipe", "block.create.encased_shaft": "齿轮箱", "block.create.extractor": "提取器", "block.create.fancy_andesite_bricks": "方纹安山岩砖", @@ -152,6 +153,7 @@ "block.create.gabbro_pillar": "竖纹辉长岩", "block.create.gearbox": "十字齿轮箱", "block.create.gearshift": "红石齿轮箱", + "block.create.glass_fluid_pipe": "UNLOCALIZED: Glass Fluid Pipe", "block.create.granite_bricks": "花岗岩砖", "block.create.granite_bricks_slab": "花岗岩砖台阶", "block.create.granite_bricks_stairs": "花岗岩砖楼梯", diff --git a/src/generated/resources/assets/create/models/block/encased_fluid_pipe.json b/src/generated/resources/assets/create/models/block/encased_fluid_pipe.json new file mode 100644 index 000000000..a8aad1994 --- /dev/null +++ b/src/generated/resources/assets/create/models/block/encased_fluid_pipe.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "side": "create:block/copper_casing", + "end": "create:block/encased_pipe" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shaped/schematics/schematic_table.json b/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shaped/schematics/schematic_table.json new file mode 100644 index 000000000..04c036f85 --- /dev/null +++ b/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shaped/schematics/schematic_table.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "create:crafting_shaped/schematics/schematic_table" + ] + }, + "criteria": { + "has_item": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:empty_schematic" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "create:crafting_shaped/schematics/schematic_table" + } + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shaped/schematics/schematicannon.json b/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shaped/schematics/schematicannon.json new file mode 100644 index 000000000..f59e6895f --- /dev/null +++ b/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shaped/schematics/schematicannon.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "create:crafting_shaped/schematics/schematicannon" + ] + }, + "criteria": { + "has_item": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:empty_schematic" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "create:crafting_shaped/schematics/schematicannon" + } + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/appliances/dough.json b/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/appliances/dough.json new file mode 100644 index 000000000..251836aea --- /dev/null +++ b/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/appliances/dough.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "create:crafting_shapeless/appliances/dough" + ] + }, + "criteria": { + "has_item": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:wheat_flour" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "create:crafting_shapeless/appliances/dough" + } + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/materials/red_sand_paper.json b/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/materials/red_sand_paper.json new file mode 100644 index 000000000..b1680e5f2 --- /dev/null +++ b/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/materials/red_sand_paper.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "create:crafting_shapeless/materials/red_sand_paper" + ] + }, + "criteria": { + "has_item": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:paper" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "create:crafting_shapeless/materials/red_sand_paper" + } + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/materials/rose_quartz.json b/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/materials/rose_quartz.json new file mode 100644 index 000000000..c14f6f1ee --- /dev/null +++ b/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/materials/rose_quartz.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "create:crafting_shapeless/materials/rose_quartz" + ] + }, + "criteria": { + "has_item": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:redstone" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "create:crafting_shapeless/materials/rose_quartz" + } + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/materials/sand_paper.json b/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/materials/sand_paper.json new file mode 100644 index 000000000..be8bede09 --- /dev/null +++ b/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/materials/sand_paper.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "create:crafting_shapeless/materials/sand_paper" + ] + }, + "criteria": { + "has_item": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:paper" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "create:crafting_shapeless/materials/sand_paper" + } + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/schematics/empty_schematic.json b/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/schematics/empty_schematic.json new file mode 100644 index 000000000..699b455c8 --- /dev/null +++ b/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/schematics/empty_schematic.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "create:crafting_shapeless/schematics/empty_schematic" + ] + }, + "criteria": { + "has_item": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:paper" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "create:crafting_shapeless/schematics/empty_schematic" + } + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/schematics/schematic_and_quill.json b/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/schematics/schematic_and_quill.json new file mode 100644 index 000000000..5b8a544b6 --- /dev/null +++ b/src/generated/resources/data/create/advancements/recipes/create.base/crafting_shapeless/schematics/schematic_and_quill.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "create:crafting_shapeless/schematics/schematic_and_quill" + ] + }, + "criteria": { + "has_item": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:paper" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "create:crafting_shapeless/schematics/schematic_and_quill" + } + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/advancements/recipes/food/crafting_shaped/appliances/cake.json b/src/generated/resources/data/create/advancements/recipes/food/crafting_shaped/appliances/cake.json new file mode 100644 index 000000000..c2974a1d8 --- /dev/null +++ b/src/generated/resources/data/create/advancements/recipes/food/crafting_shaped/appliances/cake.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "create:crafting_shaped/appliances/cake" + ] + }, + "criteria": { + "has_item": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:dough" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "create:crafting_shaped/appliances/cake" + } + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/advancements/recipes/misc/crafting_shapeless/appliances/slime_ball.json b/src/generated/resources/data/create/advancements/recipes/misc/crafting_shapeless/appliances/slime_ball.json new file mode 100644 index 000000000..1c1215af6 --- /dev/null +++ b/src/generated/resources/data/create/advancements/recipes/misc/crafting_shapeless/appliances/slime_ball.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "create:crafting_shapeless/appliances/slime_ball" + ] + }, + "criteria": { + "has_item": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:dough" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "create:crafting_shapeless/appliances/slime_ball" + } + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/loot_tables/blocks/encased_fluid_pipe.json b/src/generated/resources/data/create/loot_tables/blocks/encased_fluid_pipe.json new file mode 100644 index 000000000..034fb50f5 --- /dev/null +++ b/src/generated/resources/data/create/loot_tables/blocks/encased_fluid_pipe.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "create:fluid_pipe" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/loot_tables/blocks/glass_fluid_pipe.json b/src/generated/resources/data/create/loot_tables/blocks/glass_fluid_pipe.json new file mode 100644 index 000000000..034fb50f5 --- /dev/null +++ b/src/generated/resources/data/create/loot_tables/blocks/glass_fluid_pipe.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "create:fluid_pipe" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/recipes/crafting_shaped/appliances/cake.json b/src/generated/resources/data/create/recipes/crafting_shaped/appliances/cake.json new file mode 100644 index 000000000..abfc8661a --- /dev/null +++ b/src/generated/resources/data/create/recipes/crafting_shaped/appliances/cake.json @@ -0,0 +1,25 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " . ", + "#+#", + " - " + ], + "key": { + "#": { + "item": "minecraft:sugar" + }, + "+": { + "tag": "forge:eggs" + }, + ".": { + "item": "minecraft:milk_bucket" + }, + "-": { + "item": "create:dough" + } + }, + "result": { + "item": "minecraft:cake" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/create/recipes/crafting_shaped/schematics/schematic_table.json b/src/generated/resources/data/create/recipes/crafting_shaped/schematics/schematic_table.json new file mode 100644 index 000000000..5f1bf696f --- /dev/null +++ b/src/generated/resources/data/create/recipes/crafting_shaped/schematics/schematic_table.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "###", + " + ", + " + " + ], + "key": { + "#": { + "tag": "minecraft:wooden_slabs" + }, + "+": { + "item": "minecraft:smooth_stone" + } + }, + "result": { + "item": "create:schematic_table" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/create/recipes/crafting_shaped/schematics/schematicannon.json b/src/generated/resources/data/create/recipes/crafting_shaped/schematics/schematicannon.json new file mode 100644 index 000000000..7bdbea572 --- /dev/null +++ b/src/generated/resources/data/create/recipes/crafting_shaped/schematics/schematicannon.json @@ -0,0 +1,28 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " . ", + "#+#", + "_-_" + ], + "key": { + "#": { + "tag": "minecraft:logs" + }, + "+": { + "item": "minecraft:dispenser" + }, + ".": { + "item": "minecraft:cauldron" + }, + "_": { + "item": "minecraft:smooth_stone" + }, + "-": { + "item": "minecraft:iron_block" + } + }, + "result": { + "item": "create:schematicannon" + } +} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shapeless/dough.json b/src/generated/resources/data/create/recipes/crafting_shapeless/appliances/dough.json similarity index 81% rename from src/main/resources/data/create/recipes/crafting_shapeless/dough.json rename to src/generated/resources/data/create/recipes/crafting_shapeless/appliances/dough.json index ae00b4545..31c314fde 100644 --- a/src/main/resources/data/create/recipes/crafting_shapeless/dough.json +++ b/src/generated/resources/data/create/recipes/crafting_shapeless/appliances/dough.json @@ -9,7 +9,6 @@ } ], "result": { - "item": "create:dough", - "count": 1 + "item": "create:dough" } } \ No newline at end of file diff --git a/src/generated/resources/data/create/recipes/crafting_shapeless/appliances/slime_ball.json b/src/generated/resources/data/create/recipes/crafting_shapeless/appliances/slime_ball.json new file mode 100644 index 000000000..ec270b1fe --- /dev/null +++ b/src/generated/resources/data/create/recipes/crafting_shapeless/appliances/slime_ball.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "create:dough" + }, + { + "tag": "forge:dyes/lime" + } + ], + "result": { + "item": "minecraft:slime_ball" + } +} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shapeless/red_sand_paper.json b/src/generated/resources/data/create/recipes/crafting_shapeless/materials/red_sand_paper.json similarity index 76% rename from src/main/resources/data/create/recipes/crafting_shapeless/red_sand_paper.json rename to src/generated/resources/data/create/recipes/crafting_shapeless/materials/red_sand_paper.json index db4c142a2..c0e22c4a7 100644 --- a/src/main/resources/data/create/recipes/crafting_shapeless/red_sand_paper.json +++ b/src/generated/resources/data/create/recipes/crafting_shapeless/materials/red_sand_paper.json @@ -2,14 +2,13 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "tag": "forge:sand/red" + "item": "minecraft:paper" }, { - "item": "minecraft:paper" + "tag": "forge:sand/red" } ], "result": { - "item": "create:red_sand_paper", - "count": 1 + "item": "create:red_sand_paper" } } \ No newline at end of file diff --git a/src/generated/resources/data/create/recipes/crafting_shapeless/materials/rose_quartz.json b/src/generated/resources/data/create/recipes/crafting_shapeless/materials/rose_quartz.json new file mode 100644 index 000000000..fb32d5013 --- /dev/null +++ b/src/generated/resources/data/create/recipes/crafting_shapeless/materials/rose_quartz.json @@ -0,0 +1,35 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "forge:gems/quartz" + }, + { + "tag": "forge:dusts/redstone" + }, + { + "tag": "forge:dusts/redstone" + }, + { + "tag": "forge:dusts/redstone" + }, + { + "tag": "forge:dusts/redstone" + }, + { + "tag": "forge:dusts/redstone" + }, + { + "tag": "forge:dusts/redstone" + }, + { + "tag": "forge:dusts/redstone" + }, + { + "tag": "forge:dusts/redstone" + } + ], + "result": { + "item": "create:rose_quartz" + } +} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shapeless/sand_paper.json b/src/generated/resources/data/create/recipes/crafting_shapeless/materials/sand_paper.json similarity index 78% rename from src/main/resources/data/create/recipes/crafting_shapeless/sand_paper.json rename to src/generated/resources/data/create/recipes/crafting_shapeless/materials/sand_paper.json index b4ab613cb..945b1abd6 100644 --- a/src/main/resources/data/create/recipes/crafting_shapeless/sand_paper.json +++ b/src/generated/resources/data/create/recipes/crafting_shapeless/materials/sand_paper.json @@ -2,14 +2,13 @@ "type": "minecraft:crafting_shapeless", "ingredients": [ { - "tag": "forge:sand/colorless" + "item": "minecraft:paper" }, { - "item": "minecraft:paper" + "tag": "forge:sand/colorless" } ], "result": { - "item": "create:sand_paper", - "count": 1 + "item": "create:sand_paper" } } \ No newline at end of file diff --git a/src/generated/resources/data/create/recipes/crafting_shapeless/schematics/empty_schematic.json b/src/generated/resources/data/create/recipes/crafting_shapeless/schematics/empty_schematic.json new file mode 100644 index 000000000..796802d8b --- /dev/null +++ b/src/generated/resources/data/create/recipes/crafting_shapeless/schematics/empty_schematic.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "minecraft:paper" + }, + { + "tag": "forge:dyes/light_blue" + } + ], + "result": { + "item": "create:empty_schematic" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/create/recipes/crafting_shapeless/schematics/schematic_and_quill.json b/src/generated/resources/data/create/recipes/crafting_shapeless/schematics/schematic_and_quill.json new file mode 100644 index 000000000..d43ec9ef3 --- /dev/null +++ b/src/generated/resources/data/create/recipes/crafting_shapeless/schematics/schematic_and_quill.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "create:empty_schematic" + }, + { + "tag": "forge:feathers" + } + ], + "result": { + "item": "create:schematic_and_quill" + } +} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/AllBlockPartials.java b/src/main/java/com/simibubi/create/AllBlockPartials.java index 40d85a378..02ae1d3d0 100644 --- a/src/main/java/com/simibubi/create/AllBlockPartials.java +++ b/src/main/java/com/simibubi/create/AllBlockPartials.java @@ -9,9 +9,11 @@ import java.util.List; import java.util.Map; import com.mojang.blaze3d.matrix.MatrixStack; +import com.simibubi.create.content.contraptions.fluids.FluidPipeAttachmentBehaviour.AttachmentTypes; import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel; import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.Iterate; +import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.foundation.utility.MatrixStacker; import com.simibubi.create.foundation.utility.SuperByteBuffer; @@ -30,46 +32,28 @@ public class AllBlockPartials { public static final AllBlockPartials SCHEMATICANNON_CONNECTOR = get("schematicannon/connector"), SCHEMATICANNON_PIPE = get("schematicannon/pipe"), - SHAFTLESS_COGWHEEL = get("cogwheel_shaftless"), - SHAFT_HALF = get("shaft_half"), - - BELT_PULLEY = get("belt_pulley"), - BELT_START = get("belt/start"), - BELT_MIDDLE = get("belt/middle"), - BELT_END = get("belt/end"), - BELT_START_BOTTOM = get("belt/start_bottom"), - BELT_MIDDLE_BOTTOM = get("belt/middle_bottom"), - BELT_END_BOTTOM = get("belt/end_bottom"), - BELT_DIAGONAL_START = get("belt/diagonal_start"), - BELT_DIAGONAL_MIDDLE = get("belt/diagonal_middle"), + SHAFTLESS_COGWHEEL = get("cogwheel_shaftless"), SHAFT_HALF = get("shaft_half"), + + BELT_PULLEY = get("belt_pulley"), BELT_START = get("belt/start"), BELT_MIDDLE = get("belt/middle"), + BELT_END = get("belt/end"), BELT_START_BOTTOM = get("belt/start_bottom"), + BELT_MIDDLE_BOTTOM = get("belt/middle_bottom"), BELT_END_BOTTOM = get("belt/end_bottom"), + BELT_DIAGONAL_START = get("belt/diagonal_start"), BELT_DIAGONAL_MIDDLE = get("belt/diagonal_middle"), BELT_DIAGONAL_END = get("belt/diagonal_end"), - ENCASED_FAN_INNER = get("encased_fan/propeller"), - HAND_CRANK_HANDLE = get("hand_crank/handle"), - MECHANICAL_PRESS_HEAD = get("mechanical_press/head"), - MECHANICAL_MIXER_POLE = get("mechanical_mixer/pole"), - MECHANICAL_MIXER_HEAD = get("mechanical_mixer/head"), - MECHANICAL_CRAFTER_LID = get("mechanical_crafter/lid"), + ENCASED_FAN_INNER = get("encased_fan/propeller"), HAND_CRANK_HANDLE = get("hand_crank/handle"), + MECHANICAL_PRESS_HEAD = get("mechanical_press/head"), MECHANICAL_MIXER_POLE = get("mechanical_mixer/pole"), + MECHANICAL_MIXER_HEAD = get("mechanical_mixer/head"), MECHANICAL_CRAFTER_LID = get("mechanical_crafter/lid"), MECHANICAL_CRAFTER_ARROW = get("mechanical_crafter/arrow"), MECHANICAL_CRAFTER_BELT_FRAME = get("mechanical_crafter/belt"), - MECHANICAL_CRAFTER_BELT = get("mechanical_crafter/belt_animated"), - GAUGE_DIAL = get("gauge/dial"), - GAUGE_INDICATOR = get("gauge/indicator"), - GAUGE_HEAD_SPEED = get("gauge/speedometer/head"), - GAUGE_HEAD_STRESS = get("gauge/stressometer/head"), - BEARING_TOP = get("bearing/top"), - DRILL_HEAD = get("mechanical_drill/head"), - HARVESTER_BLADE = get("mechanical_harvester/blade"), - DEPLOYER_POLE = get("deployer/pole"), - DEPLOYER_HAND_POINTING = get("deployer/hand_pointing"), - DEPLOYER_HAND_PUNCHING = get("deployer/hand_punching"), - DEPLOYER_HAND_HOLDING = get("deployer/hand_holding"), - ANALOG_LEVER_HANDLE = get("analog_lever/handle"), - ANALOG_LEVER_INDICATOR = get("analog_lever/indicator"), - BELT_FUNNEL_FLAP = get("belt_funnel/flap"), - BELT_TUNNEL_FLAP = get("belt_tunnel/flap"), - FLEXPEATER_INDICATOR = get("diodes/indicator"), - FLYWHEEL = get("flywheel/wheel"), + MECHANICAL_CRAFTER_BELT = get("mechanical_crafter/belt_animated"), GAUGE_DIAL = get("gauge/dial"), + GAUGE_INDICATOR = get("gauge/indicator"), GAUGE_HEAD_SPEED = get("gauge/speedometer/head"), + GAUGE_HEAD_STRESS = get("gauge/stressometer/head"), BEARING_TOP = get("bearing/top"), + DRILL_HEAD = get("mechanical_drill/head"), HARVESTER_BLADE = get("mechanical_harvester/blade"), + DEPLOYER_POLE = get("deployer/pole"), DEPLOYER_HAND_POINTING = get("deployer/hand_pointing"), + DEPLOYER_HAND_PUNCHING = get("deployer/hand_punching"), DEPLOYER_HAND_HOLDING = get("deployer/hand_holding"), + ANALOG_LEVER_HANDLE = get("analog_lever/handle"), ANALOG_LEVER_INDICATOR = get("analog_lever/indicator"), + BELT_FUNNEL_FLAP = get("belt_funnel/flap"), BELT_TUNNEL_FLAP = get("belt_tunnel/flap"), + FLEXPEATER_INDICATOR = get("diodes/indicator"), FLYWHEEL = get("flywheel/wheel"), FLYWHEEL_UPPER_ROTATING = get("flywheel/upper_rotating_connector"), FLYWHEEL_LOWER_ROTATING = get("flywheel/lower_rotating_connector"), @@ -95,14 +79,14 @@ public class AllBlockPartials { MECHANICAL_PUMP_ARROW = get("mechanical_pump/arrow"), MECHANICAL_PUMP_COG = get("mechanical_pump/cog"), FLUID_PIPE_CASING = get("fluid_pipe/casing"), - + COUPLING_ATTACHMENT = getEntity("minecart_coupling/attachment"), COUPLING_RING = getEntity("minecart_coupling/ring"), COUPLING_CONNECTOR = getEntity("minecart_coupling/connector") - - ; - public static final Map PIPE_RIMS = map(); + ; + + public static final Map> PIPE_ATTACHMENTS = map(); public static final Map BLAZES = map(); static { @@ -117,8 +101,16 @@ public class AllBlockPartials { private AllBlockPartials() {} private static void populateMaps() { - for (Direction d : Iterate.directions) - PIPE_RIMS.put(d, get("fluid_pipe/rim/" + d.getName())); + for (AttachmentTypes type : AttachmentTypes.values()) { + if (!type.hasModel()) + continue; + Map map = map(); + for (Direction d : Iterate.directions) { + String asId = Lang.asId(type.name()); + map.put(d, get("fluid_pipe/" + asId + "/" + Lang.asId(d.getName()))); + } + PIPE_ATTACHMENTS.put(type, map); + } for (HeatLevel heat : HeatLevel.values()) { if (heat == HeatLevel.NONE) continue; @@ -136,7 +128,7 @@ public class AllBlockPartials { all.add(partials); return partials; } - + private static AllBlockPartials get(String path) { AllBlockPartials partials = new AllBlockPartials(); partials.modelLocation = new ResourceLocation(Create.ID, "block/" + path); diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index c4d77e2b9..f358f2969 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -59,13 +59,15 @@ import com.simibubi.create.content.contraptions.components.structureMovement.pul import com.simibubi.create.content.contraptions.components.tracks.ReinforcedRailBlock; import com.simibubi.create.content.contraptions.components.turntable.TurntableBlock; import com.simibubi.create.content.contraptions.components.waterwheel.WaterWheelBlock; -import com.simibubi.create.content.contraptions.fluids.FluidPipeBlock; -import com.simibubi.create.content.contraptions.fluids.FluidPipeModel; -import com.simibubi.create.content.contraptions.fluids.FluidTankBlock; -import com.simibubi.create.content.contraptions.fluids.FluidTankGenerator; -import com.simibubi.create.content.contraptions.fluids.FluidTankItem; -import com.simibubi.create.content.contraptions.fluids.FluidTankModel; +import com.simibubi.create.content.contraptions.fluids.PipeAttachmentModel; import com.simibubi.create.content.contraptions.fluids.PumpBlock; +import com.simibubi.create.content.contraptions.fluids.pipes.EncasedPipeBlock; +import com.simibubi.create.content.contraptions.fluids.pipes.FluidPipeBlock; +import com.simibubi.create.content.contraptions.fluids.pipes.GlassFluidPipeBlock; +import com.simibubi.create.content.contraptions.fluids.tank.FluidTankBlock; +import com.simibubi.create.content.contraptions.fluids.tank.FluidTankGenerator; +import com.simibubi.create.content.contraptions.fluids.tank.FluidTankItem; +import com.simibubi.create.content.contraptions.fluids.tank.FluidTankModel; import com.simibubi.create.content.contraptions.processing.BasinBlock; import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock; import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlockItem; @@ -219,12 +221,14 @@ public class AllBlocks { .build() .register(); - public static final BlockEntry ENCASED_SHAFT = REGISTRATE.block("encased_shaft", EncasedShaftBlock::new) + public static final BlockEntry ENCASED_SHAFT = + REGISTRATE.block("encased_shaft", EncasedShaftBlock::new) .initialProperties(SharedProperties::stone) .properties(Block.Properties::nonOpaque) .transform(StressConfigDefaults.setNoImpact()) - //.blockstate(BlockStateGen.axisBlockProvider(true)) - .blockstate((c, p) -> axisBlock(c, p, blockState -> p.models().getExistingFile(p.modLoc("block/encased_shaft/" + blockState.get(EncasedShaftBlock.CASING).getName())))) + .blockstate((c, p) -> axisBlock(c, p, blockState -> p.models() + .getExistingFile(p.modLoc("block/encased_shaft/" + blockState.get(EncasedShaftBlock.CASING) + .getName())))) .loot((p, b) -> p.registerDropping(b, SHAFT.get())) .register(); @@ -461,14 +465,34 @@ public class AllBlocks { public static final BlockEntry FLUID_PIPE = REGISTRATE.block("fluid_pipe", FluidPipeBlock::new) .initialProperties(SharedProperties::softMetal) .blockstate(BlockStateGen.pipe()) - .onRegister(CreateRegistrate.blockModel(() -> FluidPipeModel::new)) + .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::new)) .item() .transform(customItemModel()) .register(); + public static final BlockEntry ENCASED_FLUID_PIPE = + REGISTRATE.block("encased_fluid_pipe", EncasedPipeBlock::new) + .initialProperties(SharedProperties::softMetal) + .blockstate((c, p) -> BlockStateGen.axisBlock(c, p, state -> p.models() + .cubeColumn(c.getName(), p.modLoc("block/copper_casing"), p.modLoc("block/encased_pipe")))) + .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::new)) + .loot((p, b) -> p.registerDropping(b, FLUID_PIPE.get())) + .register(); + + public static final BlockEntry GLASS_FLUID_PIPE = + REGISTRATE.block("glass_fluid_pipe", GlassFluidPipeBlock::new) + .initialProperties(SharedProperties::softMetal) + .addLayer(() -> RenderType::getCutoutMipped) + .blockstate((c, p) -> BlockStateGen.axisBlock(c, p, s -> p.models() + .getExistingFile(p.modLoc("block/fluid_pipe/window" + (s.get(GlassFluidPipeBlock.ALT) ? "_alt" : ""))))) + .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::new)) + .loot((p, b) -> p.registerDropping(b, FLUID_PIPE.get())) + .register(); + public static final BlockEntry MECHANICAL_PUMP = REGISTRATE.block("mechanical_pump", PumpBlock::new) .initialProperties(SharedProperties::softMetal) .blockstate(BlockStateGen.directionalBlockProviderIgnoresWaterlogged(true)) + .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::new)) .transform(StressConfigDefaults.setImpact(4.0)) .item() .transform(customItemModel()) diff --git a/src/main/java/com/simibubi/create/AllShapes.java b/src/main/java/com/simibubi/create/AllShapes.java index f3792a945..ea7bba3c1 100644 --- a/src/main/java/com/simibubi/create/AllShapes.java +++ b/src/main/java/com/simibubi/create/AllShapes.java @@ -6,6 +6,7 @@ import static net.minecraft.util.Direction.UP; import java.util.function.BiFunction; +import com.simibubi.create.content.logistics.block.chute.ChuteShapes; import com.simibubi.create.foundation.utility.VoxelShaper; import net.minecraft.block.Block; @@ -28,6 +29,7 @@ public class AllShapes { CASING_11PX = shape(0, 0, 0, 16, 11, 16).forDirectional(), MOTOR_BLOCK = shape(3, 0, 3, 13, 14, 13).forDirectional(), FOUR_VOXEL_POLE = shape(6, 0, 6, 10, 16, 10).forAxis(), SIX_VOXEL_POLE = shape(5, 0, 5, 11, 16, 11).forAxis(), + EIGHT_VOXEL_POLE = shape(4, 0, 4, 12, 16, 12).forAxis(), EXTRACTOR = shape(4, 2, 11, 12, 10, 17).forDirectional(SOUTH) .withVerticalShapes(cuboid(4, 11, 4, 12, 17, 12)), TRANSPOSER = shape(4, 4, -1, 12, 12, 1).add(5, 5, 0, 11, 11, 16) @@ -111,14 +113,16 @@ public class AllShapes { // Static Block Shapes public static final VoxelShape - BASIN_BLOCK_SHAPE = shape(0, 2, 0, 16, 13, 16).erase(2, 5, 2, 14, 14, 14) + BASIN_BLOCK_SHAPE = shape(0, 2, 0, 16, 16, 16).erase(2, 2, 2, 14, 16, 14) .add(2, 0, 2, 14, 2, 14) - .build(), HEATER_BLOCK_SHAPE = - shape(2, 0, 2, 14, 14, 14).add(0, 0, 0, 16, 4, 16) + .build(), BASIN_COLLISION_SHAPE = + shape(0, 2, 0, 16, 16, 16).erase(2, 5, 2, 14, 16, 14) + .add(2, 0, 2, 14, 2, 14) .build(), + HEATER_BLOCK_SHAPE = shape(2, 0, 2, 14, 14, 14).add(0, 0, 0, 16, 4, 16) + .build(), HEATER_BLOCK_SPECIAL_COLLISION_SHAPE = shape(0, 0, 0, 16, 4, 16).build(), - CRUSHING_WHEEL_COLLISION_SHAPE = cuboid(0, 0, 0, 16, 22, 16), - SEAT = cuboid(0, 0, 0, 16, 8, 16), + CRUSHING_WHEEL_COLLISION_SHAPE = cuboid(0, 0, 0, 16, 22, 16), SEAT = cuboid(0, 0, 0, 16, 8, 16), SEAT_COLLISION = cuboid(0, 0, 0, 16, 6, 16), MECHANICAL_PROCESSOR_SHAPE = shape(VoxelShapes.fullCube()).erase(4, 0, 4, 12, 16, 12) .build(), @@ -171,7 +175,8 @@ public class AllShapes { LOGISTICS_TABLE = shape(TABLE_POLE_SHAPE).add(LOGISTICS_TABLE_SLOPE) .forHorizontal(SOUTH), SCHEMATICS_TABLE = shape(TABLE_POLE_SHAPE).add(SCHEMATICS_TABLE_SLOPE) - .forDirectional(SOUTH) + .forDirectional(SOUTH), + CHUTE_SLOPE = shape(ChuteShapes.createSlope()).forHorizontal(SOUTH) ; diff --git a/src/main/java/com/simibubi/create/AllSoundEvents.java b/src/main/java/com/simibubi/create/AllSoundEvents.java index a46d188ad..8b71097aa 100644 --- a/src/main/java/com/simibubi/create/AllSoundEvents.java +++ b/src/main/java/com/simibubi/create/AllSoundEvents.java @@ -44,7 +44,7 @@ public enum AllSoundEvents implements IDataProvider { AllSoundEvents() { id = Lang.asId(name()); } - + AllSoundEvents(String name) { id = name; } @@ -65,7 +65,7 @@ public enum AllSoundEvents implements IDataProvider { return id; } - public AllSoundEvents generator(DataGenerator generator){ + public AllSoundEvents generator(DataGenerator generator) { this.generator = generator; return this; } @@ -83,7 +83,9 @@ public enum AllSoundEvents implements IDataProvider { } public void generate(Path path, DirectoryCache cache) { - Gson GSON = (new GsonBuilder()).setPrettyPrinting().disableHtmlEscaping().create(); + Gson GSON = (new GsonBuilder()).setPrettyPrinting() + .disableHtmlEscaping() + .create(); path = path.resolve("assets/create"); try { @@ -94,7 +96,8 @@ public enum AllSoundEvents implements IDataProvider { if (soundEvent.child != null) { // wrapper JsonObject s = new JsonObject(); - s.addProperty("name", soundEvent.child.getName().toString()); + s.addProperty("name", soundEvent.child.getName() + .toString()); s.addProperty("type", "event"); arr.add(s); } else { @@ -120,6 +123,6 @@ public enum AllSoundEvents implements IDataProvider { @Override public String getName() { - return null; + return "Create's Custom Sound: " + name(); } } diff --git a/src/main/java/com/simibubi/create/AllSpecialTextures.java b/src/main/java/com/simibubi/create/AllSpecialTextures.java index 6cccf5b71..27f11391a 100644 --- a/src/main/java/com/simibubi/create/AllSpecialTextures.java +++ b/src/main/java/com/simibubi/create/AllSpecialTextures.java @@ -11,6 +11,7 @@ public enum AllSpecialTextures { BLANK("blank.png"), CHECKERED("checkerboard.png"), THIN_CHECKERED("thin_checkerboard.png"), + CUTOUT_CHECKERED("cutout_checkerboard.png"), HIGHLIGHT_CHECKERED("highlighted_checkerboard.png"), SELECTION("selection.png"), diff --git a/src/main/java/com/simibubi/create/AllTileEntities.java b/src/main/java/com/simibubi/create/AllTileEntities.java index 0225deada..7d969877a 100644 --- a/src/main/java/com/simibubi/create/AllTileEntities.java +++ b/src/main/java/com/simibubi/create/AllTileEntities.java @@ -43,10 +43,13 @@ import com.simibubi.create.content.contraptions.components.structureMovement.pul import com.simibubi.create.content.contraptions.components.structureMovement.pulley.PulleyTileEntity; import com.simibubi.create.content.contraptions.components.turntable.TurntableTileEntity; import com.simibubi.create.content.contraptions.components.waterwheel.WaterWheelTileEntity; -import com.simibubi.create.content.contraptions.fluids.FluidTankRenderer; -import com.simibubi.create.content.contraptions.fluids.FluidTankTileEntity; import com.simibubi.create.content.contraptions.fluids.PumpRenderer; import com.simibubi.create.content.contraptions.fluids.PumpTileEntity; +import com.simibubi.create.content.contraptions.fluids.pipes.FluidPipeTileEntity; +import com.simibubi.create.content.contraptions.fluids.pipes.StraightPipeTileEntity; +import com.simibubi.create.content.contraptions.fluids.pipes.TransparentStraightPipeRenderer; +import com.simibubi.create.content.contraptions.fluids.tank.FluidTankRenderer; +import com.simibubi.create.content.contraptions.fluids.tank.FluidTankTileEntity; import com.simibubi.create.content.contraptions.processing.BasinRenderer; import com.simibubi.create.content.contraptions.processing.BasinTileEntity; import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerRenderer; @@ -57,7 +60,11 @@ import com.simibubi.create.content.contraptions.relays.advanced.sequencer.Sequen import com.simibubi.create.content.contraptions.relays.belt.BeltRenderer; import com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity; import com.simibubi.create.content.contraptions.relays.elementary.SimpleKineticTileEntity; -import com.simibubi.create.content.contraptions.relays.encased.*; +import com.simibubi.create.content.contraptions.relays.encased.AdjustablePulleyTileEntity; +import com.simibubi.create.content.contraptions.relays.encased.ClutchTileEntity; +import com.simibubi.create.content.contraptions.relays.encased.EncasedShaftRenderer; +import com.simibubi.create.content.contraptions.relays.encased.EncasedShaftTileEntity; +import com.simibubi.create.content.contraptions.relays.encased.SplitShaftRenderer; import com.simibubi.create.content.contraptions.relays.gauge.GaugeRenderer; import com.simibubi.create.content.contraptions.relays.gauge.SpeedGaugeTileEntity; import com.simibubi.create.content.contraptions.relays.gauge.StressGaugeTileEntity; @@ -86,7 +93,12 @@ import com.simibubi.create.content.logistics.block.mechanicalArm.ArmRenderer; import com.simibubi.create.content.logistics.block.mechanicalArm.ArmTileEntity; import com.simibubi.create.content.logistics.block.packager.PackagerRenderer; import com.simibubi.create.content.logistics.block.packager.PackagerTileEntity; -import com.simibubi.create.content.logistics.block.redstone.*; +import com.simibubi.create.content.logistics.block.redstone.AnalogLeverRenderer; +import com.simibubi.create.content.logistics.block.redstone.AnalogLeverTileEntity; +import com.simibubi.create.content.logistics.block.redstone.NixieTubeRenderer; +import com.simibubi.create.content.logistics.block.redstone.NixieTubeTileEntity; +import com.simibubi.create.content.logistics.block.redstone.RedstoneLinkTileEntity; +import com.simibubi.create.content.logistics.block.redstone.StockpileSwitchTileEntity; import com.simibubi.create.content.logistics.block.transposer.LinkedTransposerTileEntity; import com.simibubi.create.content.logistics.block.transposer.TransposerTileEntity; import com.simibubi.create.content.schematics.block.SchematicTableTileEntity; @@ -95,6 +107,7 @@ import com.simibubi.create.content.schematics.block.SchematicannonTileEntity; import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer; import com.tterrag.registrate.util.entry.TileEntityEntry; import com.tterrag.registrate.util.nullness.NonNullFunction; + import net.minecraft.tileentity.TileEntityType; public class AllTileEntities { @@ -191,6 +204,22 @@ public class AllTileEntities { .renderer(() -> PumpRenderer::new) .register(); + public static final TileEntityEntry FLUID_PIPE = Create.registrate() + .tileEntity("fluid_pipe", FluidPipeTileEntity::new) + .validBlocks(AllBlocks.FLUID_PIPE) + .register(); + + public static final TileEntityEntry ENCASED_FLUID_PIPE = Create.registrate() + .tileEntity("encased_fluid_pipe", StraightPipeTileEntity::new) + .validBlocks(AllBlocks.ENCASED_FLUID_PIPE) + .register(); + + public static final TileEntityEntry GLASS_FLUID_PIPE = Create.registrate() + .tileEntity("glass_fluid_pipe", StraightPipeTileEntity::new) + .validBlocks(AllBlocks.GLASS_FLUID_PIPE) + .renderer(() -> TransparentStraightPipeRenderer::new) + .register(); + public static final TileEntityEntry FLUID_TANK = Create.registrate() .tileEntity("fluid_tank", (NonNullFunction, ? extends FluidTankTileEntity>) FluidTankTileEntity::new) .validBlocks(AllBlocks.FLUID_TANK) diff --git a/src/main/java/com/simibubi/create/Create.java b/src/main/java/com/simibubi/create/Create.java index addfa5821..63403a5a3 100644 --- a/src/main/java/com/simibubi/create/Create.java +++ b/src/main/java/com/simibubi/create/Create.java @@ -15,6 +15,7 @@ import com.simibubi.create.foundation.command.ServerLagger; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.data.CreateRegistrate; import com.simibubi.create.foundation.data.LangMerger; +import com.simibubi.create.foundation.data.StandardRecipes; import com.simibubi.create.foundation.networking.AllPackets; import com.simibubi.create.foundation.worldgen.AllWorldFeatures; import com.tterrag.registrate.util.NonNullLazyValue; @@ -102,6 +103,7 @@ public class Create { DataGenerator gen = event.getGenerator(); gen.addProvider(new AllAdvancements(gen)); gen.addProvider(new LangMerger(gen)); + gen.addProvider(new StandardRecipes(gen)); gen.addProvider(AllSoundEvents.BLAZE_MUNCH.generator(gen)); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/KineticDebugger.java b/src/main/java/com/simibubi/create/content/contraptions/KineticDebugger.java index aa087c7c7..47b109c2f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/KineticDebugger.java +++ b/src/main/java/com/simibubi/create/content/contraptions/KineticDebugger.java @@ -43,7 +43,7 @@ public class KineticDebugger { VoxelShape shape = world.getBlockState(toOutline) .getRenderShape(world, toOutline); - if (te.getTheoreticalSpeed() != 0) + if (te.getTheoreticalSpeed() != 0 && !shape.isEmpty()) CreateClient.outliner.chaseAABB("kineticSource", shape.getBoundingBox() .offset(toOutline)) .lineWidth(1 / 16f) diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java index 023927120..e376fe488 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java @@ -178,7 +178,7 @@ public abstract class KineticTileEntity extends SmartTileEntity } @Override - public CompoundNBT write(CompoundNBT compound) { + protected void write(CompoundNBT compound, boolean clientPacket) { compound.putFloat("Speed", speed); if (needsSpeedUpdate()) @@ -202,7 +202,7 @@ public abstract class KineticTileEntity extends SmartTileEntity compound.put("Network", networkTag); } - return super.write(compound); + super.write(compound, clientPacket); } public boolean needsSpeedUpdate() { @@ -210,12 +210,13 @@ public abstract class KineticTileEntity extends SmartTileEntity } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { + boolean overStressedBefore = overStressed; clearKineticInformation(); // DO NOT READ kinetic information when placed after movement if (wasMoved) { - super.read(compound); + super.read(compound, clientPacket); return; } @@ -235,14 +236,9 @@ public abstract class KineticTileEntity extends SmartTileEntity overStressed = capacity < stress && StressImpact.isEnabled(); } - super.read(compound); - } + super.read(compound, clientPacket); - @Override - public void readClientUpdate(CompoundNBT tag) { - boolean overStressedBefore = overStressed; - super.readClientUpdate(tag); - if (overStressedBefore != overStressed && speed != 0) + if (clientPacket && overStressedBefore != overStressed && speed != 0) effects.triggerOverStressedEffect(); } @@ -450,7 +446,7 @@ public abstract class KineticTileEntity extends SmartTileEntity public int getFlickerScore() { return flickerTally; } - + public static float convertToDirection(float axisSpeed, Direction d) { return d.getAxisDirection() == AxisDirection.POSITIVE ? axisSpeed : -axisSpeed; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/BlockBreakingKineticTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/BlockBreakingKineticTileEntity.java index 5ac4e1b75..d6152bc98 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/BlockBreakingKineticTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/BlockBreakingKineticTileEntity.java @@ -58,21 +58,21 @@ public abstract class BlockBreakingKineticTileEntity extends KineticTileEntity { } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.putInt("Progress", destroyProgress); compound.putInt("NextTick", ticksUntilNextProgress); if (breakingPos != null) compound.put("Breaking", NBTUtil.writeBlockPos(breakingPos)); - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { destroyProgress = compound.getInt("Progress"); ticksUntilNextProgress = compound.getInt("NextTick"); if (compound.contains("Breaking")) breakingPos = NBTUtil.readBlockPos(compound.getCompound("Breaking")); - super.read(compound); + super.read(compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/PloughBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PloughBlock.java index 686fbc86f..31a5ffad3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/PloughBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PloughBlock.java @@ -3,7 +3,6 @@ package com.simibubi.create.content.contraptions.components.actors; import java.util.UUID; import com.mojang.authlib.GameProfile; -import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour; import net.minecraft.world.server.ServerWorld; import net.minecraftforge.common.util.FakePlayer; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockTileEntity.java index e67a32739..49d35a7c4 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockTileEntity.java @@ -39,23 +39,23 @@ public class CuckooClockTileEntity extends KineticTileEntity { super(type); animationType = Animation.NONE; } - + @Override - public CompoundNBT writeToClient(CompoundNBT compound) { - if (sendAnimationUpdate) - NBTHelper.writeEnum(compound, "Animation", animationType); - sendAnimationUpdate = false; - return super.writeToClient(compound); - } - - @Override - public void readClientUpdate(CompoundNBT tag) { - if (tag.contains("Animation")) { - animationType = NBTHelper.readEnum(tag, "Animation", Animation.class); + protected void read(CompoundNBT compound, boolean clientPacket) { + super.read(compound, clientPacket); + if (clientPacket && compound.contains("Animation")) { + animationType = NBTHelper.readEnum(compound, "Animation", Animation.class); animationProgress.lastValue = 0; animationProgress.value = 0; } - super.readClientUpdate(tag); + } + + @Override + public void write(CompoundNBT compound, boolean clientPacket) { + if (clientPacket && sendAnimationUpdate) + NBTHelper.writeEnum(compound, "Animation", animationType); + sendAnimationUpdate = false; + super.write(compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterTileEntity.java index 8bace4b11..2ec559970 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterTileEntity.java @@ -123,7 +123,7 @@ public class MechanicalCrafterTileEntity extends KineticTileEntity { } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.put("Inventory", inventory.serializeNBT()); CompoundNBT inputNBT = new CompoundNBT(); @@ -138,43 +138,19 @@ public class MechanicalCrafterTileEntity extends KineticTileEntity { compound.putInt("CountDown", countDown); compound.putBoolean("Cover", covered); - return super.write(compound); - } - - @Override - public CompoundNBT writeToClient(CompoundNBT tag) { - if (reRender) { - tag.putBoolean("Redraw", true); + super.write(compound, clientPacket); + + if (clientPacket && reRender) { + compound.putBoolean("Redraw", true); reRender = false; } - return super.writeToClient(tag); } @Override - public void readClientUpdate(CompoundNBT tag) { - if (tag.contains("Redraw")) - world.notifyBlockUpdate(getPos(), getBlockState(), getBlockState(), 16); - + protected void read(CompoundNBT compound, boolean clientPacket) { Phase phaseBefore = phase; GroupedItems before = this.groupedItems; - - super.readClientUpdate(tag); - - if (phaseBefore != phase && phase == Phase.CRAFTING) - groupedItemsBeforeCraft = before; - if (phaseBefore == Phase.EXPORTING && phase == Phase.WAITING) { - Direction facing = getBlockState().get(MechanicalCrafterBlock.HORIZONTAL_FACING); - Vec3d vec = new Vec3d(facing.getDirectionVec()).scale(.75) - .add(VecHelper.getCenterOf(pos)); - Direction targetDirection = MechanicalCrafterBlock.getTargetDirection(getBlockState()); - vec = vec.add(new Vec3d(targetDirection.getDirectionVec()).scale(1)); - world.addParticle(ParticleTypes.CRIT, vec.x, vec.y, vec.z, 0, 0, 0); - } - - } - - @Override - public void read(CompoundNBT compound) { + inventory.deserializeNBT(compound.getCompound("Inventory")); input.read(compound.getCompound("ConnectedInput")); groupedItems = GroupedItems.read(compound.getCompound("GroupedItems")); @@ -186,7 +162,22 @@ public class MechanicalCrafterTileEntity extends KineticTileEntity { this.phase = phase; countDown = compound.getInt("CountDown"); covered = compound.getBoolean("Cover"); - super.read(compound); + super.read(compound, clientPacket); + + if (!clientPacket) + return; + if (compound.contains("Redraw")) + world.notifyBlockUpdate(getPos(), getBlockState(), getBlockState(), 16); + if (phaseBefore != phase && phase == Phase.CRAFTING) + groupedItemsBeforeCraft = before; + if (phaseBefore == Phase.EXPORTING && phase == Phase.WAITING) { + Direction facing = getBlockState().get(MechanicalCrafterBlock.HORIZONTAL_FACING); + Vec3d vec = new Vec3d(facing.getDirectionVec()).scale(.75) + .add(VecHelper.getCenterOf(pos)); + Direction targetDirection = MechanicalCrafterBlock.getTargetDirection(getBlockState()); + vec = vec.add(new Vec3d(targetDirection.getDirectionVec()).scale(1)); + world.addParticle(ParticleTypes.CRIT, vec.x, vec.y, vec.z, 0, 0, 0); + } } @Override @@ -293,7 +284,7 @@ public class MechanicalCrafterTileEntity extends KineticTileEntity { Vec3d vec = facingVec.scale(.65) .add(VecHelper.getCenterOf(pos)); Vec3d offset = VecHelper.offsetRandomly(Vec3d.ZERO, world.rand, .125f) - .mul(VecHelper.planeByNormal(facingVec)) + .mul(VecHelper.axisAlingedPlaneOf(facingVec)) .normalize() .scale(progress * .5f) .add(vec); @@ -307,7 +298,7 @@ public class MechanicalCrafterTileEntity extends KineticTileEntity { for (int i = 0; i < 10; i++) { Vec3d randVec = VecHelper.offsetRandomly(Vec3d.ZERO, world.rand, .125f) - .mul(VecHelper.planeByNormal(facingVec)) + .mul(VecHelper.axisAlingedPlaneOf(facingVec)) .normalize() .scale(.25f); Vec3d offset2 = randVec.add(vec); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankTileEntity.java index c1af6a112..492cc9dcf 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankTileEntity.java @@ -38,15 +38,15 @@ public class HandCrankTileEntity extends GeneratingKineticTileEntity { } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.putInt("InUse", inUse); - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { inUse = compound.getInt("InUse"); - super.read(compound); + super.read(compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java index 3f5eeec54..b4aa3ffb7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java @@ -215,19 +215,17 @@ public class CrushingWheelControllerTileEntity extends SmartTileEntity { } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { if (hasEntity()) compound.put("Entity", NBTUtil.writeUniqueId(entityUUID)); compound.put("Inventory", inventory.serializeNBT()); compound.putFloat("Speed", crushingspeed); - - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT compound) { - super.read(compound); - + protected void read(CompoundNBT compound, boolean clientPacket) { + super.read(compound, clientPacket); if (compound.contains("Entity") && !isFrozen() && !isOccupied()) { entityUUID = NBTUtil.readUniqueId(compound.getCompound("Entity")); this.searchForEntity = true; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java index 825b15add..c286ed1cc 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java @@ -51,11 +51,10 @@ import net.minecraftforge.items.ItemHandlerHelper; public class DeployerTileEntity extends KineticTileEntity { - private static final List> EXTRACTING_LOCATIONS = Arrays - .asList(Direction.values()) - .stream() - .map(d -> Pair.of(BlockPos.ZERO.offset(d), d.getOpposite())) - .collect(Collectors.toList()); + private static final List> EXTRACTING_LOCATIONS = Arrays.asList(Direction.values()) + .stream() + .map(d -> Pair.of(BlockPos.ZERO.offset(d), d.getOpposite())) + .collect(Collectors.toList()); private FilteringBehaviour filtering; private ExtractingBehaviour extracting; @@ -167,7 +166,8 @@ public class DeployerTileEntity extends KineticTileEntity { return; } - if (filtering.getFilter().isEmpty() && stack.isEmpty()) + if (filtering.getFilter() + .isEmpty() && stack.isEmpty()) extracting.extract(1); Direction facing = getBlockState().get(FACING); @@ -182,12 +182,16 @@ public class DeployerTileEntity extends KineticTileEntity { state = State.EXPANDING; Vec3d movementVector = getMovementVector(); - Vec3d rayOrigin = VecHelper.getCenterOf(pos).add(movementVector.scale(3 / 2f)); - Vec3d rayTarget = VecHelper.getCenterOf(pos).add(movementVector.scale(5 / 2f)); + Vec3d rayOrigin = VecHelper.getCenterOf(pos) + .add(movementVector.scale(3 / 2f)); + Vec3d rayTarget = VecHelper.getCenterOf(pos) + .add(movementVector.scale(5 / 2f)); RayTraceContext rayTraceContext = new RayTraceContext(rayOrigin, rayTarget, BlockMode.OUTLINE, FluidMode.NONE, player); BlockRayTraceResult result = world.rayTraceBlocks(rayTraceContext); - reach = (float) (.5f + Math.min(result.getHitVec().subtract(rayOrigin).length(), .75f)); + reach = (float) (.5f + Math.min(result.getHitVec() + .subtract(rayOrigin) + .length(), .75f)); timer = 1000; sendData(); @@ -226,7 +230,9 @@ public class DeployerTileEntity extends KineticTileEntity { if (!(otherTile instanceof DeployerTileEntity)) return false; DeployerTileEntity deployerTile = (DeployerTileEntity) otherTile; - if (world.getBlockState(otherDeployer).get(FACING).getOpposite() != facing || deployerTile.mode != Mode.PUNCH) + if (world.getBlockState(otherDeployer) + .get(FACING) + .getOpposite() != facing || deployerTile.mode != Mode.PUNCH) return false; boop = true; @@ -295,13 +301,15 @@ public class DeployerTileEntity extends KineticTileEntity { } protected void tryDisposeOfItems() { - boolean noInv = extracting.getInventories().isEmpty(); + boolean noInv = extracting.getInventories() + .isEmpty(); for (Iterator iterator = overflowItems.iterator(); iterator.hasNext();) { ItemStack itemStack = iterator.next(); if (noInv) { Vec3d offset = getMovementVector(); - Vec3d outPos = VecHelper.getCenterOf(pos).add(offset.scale(-.65f)); + Vec3d outPos = VecHelper.getCenterOf(pos) + .add(offset.scale(-.65f)); Vec3d motion = offset.scale(-.25f); ItemEntity e = new ItemEntity(world, outPos.x, outPos.y, outPos.z, itemStack.copy()); e.setMotion(motion); @@ -328,11 +336,12 @@ public class DeployerTileEntity extends KineticTileEntity { protected Vec3d getMovementVector() { if (!AllBlocks.DEPLOYER.has(getBlockState())) return Vec3d.ZERO; - return new Vec3d(getBlockState().get(FACING).getDirectionVec()); + return new Vec3d(getBlockState().get(FACING) + .getDirectionVec()); } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { state = NBTHelper.readEnum(compound, "State", State.class); mode = NBTHelper.readEnum(compound, "Mode", Mode.class); timer = compound.getInt("Timer"); @@ -340,48 +349,45 @@ public class DeployerTileEntity extends KineticTileEntity { overflowItems = NBTHelper.readItemList(compound.getList("Overflow", NBT.TAG_COMPOUND)); if (compound.contains("HeldItem")) heldItem = ItemStack.read(compound.getCompound("HeldItem")); - super.read(compound); + super.read(compound, clientPacket); + + if (!clientPacket) + return; + reach = compound.getFloat("Reach"); + if (compound.contains("Particle")) { + ItemStack particleStack = ItemStack.read(compound.getCompound("Particle")); + SandPaperItem.spawnParticles(VecHelper.getCenterOf(pos) + .add(getMovementVector().scale(2f)), particleStack, this.world); + } } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { NBTHelper.writeEnum(compound, "Mode", mode); NBTHelper.writeEnum(compound, "State", state); compound.putInt("Timer", timer); if (player != null) { - compound.put("HeldItem", player.getHeldItemMainhand().serializeNBT()); + compound.put("HeldItem", player.getHeldItemMainhand() + .serializeNBT()); ListNBT invNBT = new ListNBT(); player.inventory.write(invNBT); compound.put("Inventory", invNBT); compound.put("Overflow", NBTHelper.writeItemList(overflowItems)); } - return super.write(compound); - } + + super.write(compound, clientPacket); - @Override - public CompoundNBT writeToClient(CompoundNBT compound) { + if (!clientPacket) + return; compound.putFloat("Reach", reach); - if (player != null) { - compound.put("HeldItem", player.getHeldItemMainhand().serializeNBT()); - if (player.spawnedItemEffects != null) { - compound.put("Particle", player.spawnedItemEffects.serializeNBT()); - player.spawnedItemEffects = null; - } + if (player == null) + return; + compound.put("HeldItem", player.getHeldItemMainhand() + .serializeNBT()); + if (player.spawnedItemEffects != null) { + compound.put("Particle", player.spawnedItemEffects.serializeNBT()); + player.spawnedItemEffects = null; } - return super.writeToClient(compound); - } - - @Override - public void readClientUpdate(CompoundNBT tag) { - reach = tag.getFloat("Reach"); - if (tag.contains("Particle")) { - ItemStack particleStack = ItemStack.read(tag.getCompound("Particle")); - SandPaperItem - .spawnParticles(VecHelper.getCenterOf(pos).add(getMovementVector().scale(2f)), particleStack, - this.world); - } - - super.readClientUpdate(tag); } private IItemHandlerModifiable createHandler() { @@ -395,7 +401,7 @@ public class DeployerTileEntity extends KineticTileEntity { public AllBlockPartials getHandPose() { return mode == Mode.PUNCH ? AllBlockPartials.DEPLOYER_HAND_PUNCHING - : heldItem.isEmpty() ? AllBlockPartials.DEPLOYER_HAND_POINTING : AllBlockPartials.DEPLOYER_HAND_HOLDING; + : heldItem.isEmpty() ? AllBlockPartials.DEPLOYER_HAND_POINTING : AllBlockPartials.DEPLOYER_HAND_HOLDING; } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/AirCurrent.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/AirCurrent.java index b0e415670..124409bb7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/AirCurrent.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/AirCurrent.java @@ -165,7 +165,7 @@ public class AirCurrent { .get(BlockStateProperties.FACING); pushing = source.getAirFlowDirection() == direction; Vec3d directionVec = new Vec3d(direction.getDirectionVec()); - Vec3d planeVec = VecHelper.planeByNormal(directionVec); + Vec3d planeVec = VecHelper.axisAlingedPlaneOf(directionVec); // 4 Rays test for holes in the shapes blocking the flow float offsetDistance = .25f; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanTileEntity.java index a50454373..6a881f464 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanTileEntity.java @@ -6,6 +6,7 @@ import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlo import com.simibubi.create.content.logistics.block.chute.ChuteTileEntity; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.config.CKinetics; + import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.state.properties.BlockStateProperties; @@ -30,21 +31,17 @@ public class EncasedFanTileEntity extends GeneratingKineticTileEntity { } @Override - public void readClientUpdate(CompoundNBT tag) { - super.readClientUpdate(tag); - airCurrent.rebuild(); - } - - @Override - public void read(CompoundNBT compound) { - super.read(compound); + protected void read(CompoundNBT compound, boolean clientPacket) { + super.read(compound, clientPacket); isGenerator = compound.getBoolean("Generating"); + if (clientPacket) + airCurrent.rebuild(); } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.putBoolean("Generating", isGenerator); - return super.write(compound); + super.write(compound, clientPacket); } @Override @@ -77,10 +74,12 @@ public class EncasedFanTileEntity extends GeneratingKineticTileEntity { return false; BlockState checkState = world.getBlockState(pos.down()); - if (!checkState.getBlock().isIn(AllBlockTags.FAN_HEATERS.tag)) + if (!checkState.getBlock() + .isIn(AllBlockTags.FAN_HEATERS.tag)) return false; - if (checkState.has(BlazeBurnerBlock.HEAT_LEVEL) && !checkState.get(BlazeBurnerBlock.HEAT_LEVEL).isAtLeast(BlazeBurnerBlock.HeatLevel.FADING)) + if (checkState.has(BlazeBurnerBlock.HEAT_LEVEL) && !checkState.get(BlazeBurnerBlock.HEAT_LEVEL) + .isAtLeast(BlazeBurnerBlock.HeatLevel.FADING)) return false; if (checkState.has(BlockStateProperties.LIT) && !checkState.get(BlockStateProperties.LIT)) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleTileEntity.java index 81ce41fb2..927540595 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleTileEntity.java @@ -38,26 +38,30 @@ public class NozzleTileEntity extends SmartTileEntity { } @Override - public void addBehaviours(List behaviours) { - } + public void addBehaviours(List behaviours) {} @Override - public CompoundNBT writeToClient(CompoundNBT compound) { + protected void write(CompoundNBT compound, boolean clientPacket) { + super.write(compound, clientPacket); + if (!clientPacket) + return; compound.putFloat("Range", range); compound.putBoolean("Pushing", pushing); - return super.writeToClient(compound); } - + @Override - public void readClientUpdate(CompoundNBT tag) { - range = tag.getFloat("Range"); - pushing = tag.getBoolean("Pushing"); - super.readClientUpdate(tag); + protected void read(CompoundNBT compound, boolean clientPacket) { + super.read(compound, clientPacket); + if (!clientPacket) + return; + range = compound.getFloat("Range"); + pushing = compound.getBoolean("Pushing"); } @Override public void initialize() { - fanPos = pos.offset(getBlockState().get(NozzleBlock.FACING).getOpposite()); + fanPos = pos.offset(getBlockState().get(NozzleBlock.FACING) + .getOpposite()); super.initialize(); } @@ -72,24 +76,26 @@ public class NozzleTileEntity extends SmartTileEntity { Vec3d center = VecHelper.getCenterOf(pos); if (world.isRemote && range != 0) { if (world.rand.nextInt( - MathHelper.clamp((AllConfigs.SERVER.kinetics.fanPushDistance.get() - (int) range), 1, 10)) == 0) { + MathHelper.clamp((AllConfigs.SERVER.kinetics.fanPushDistance.get() - (int) range), 1, 10)) == 0) { Vec3d start = VecHelper.offsetRandomly(center, world.rand, pushing ? 1 : range / 2); - Vec3d motion = center.subtract(start).normalize() - .scale(MathHelper.clamp(range * (pushing ? .025f : 1f), 0, .5f) * (pushing ? -1 : 1)); + Vec3d motion = center.subtract(start) + .normalize() + .scale(MathHelper.clamp(range * (pushing ? .025f : 1f), 0, .5f) * (pushing ? -1 : 1)); world.addParticle(ParticleTypes.POOF, start.x, start.y, start.z, motion.x, motion.y, motion.z); } } for (Iterator iterator = pushingEntities.iterator(); iterator.hasNext();) { Entity entity = iterator.next(); - Vec3d diff = entity.getPositionVec().subtract(center); + Vec3d diff = entity.getPositionVec() + .subtract(center); if (!(entity instanceof PlayerEntity) && world.isRemote) continue; double distance = diff.length(); if (distance > range || entity.isSneaking() - || (entity instanceof PlayerEntity && ((PlayerEntity) entity).isCreative())) { + || (entity instanceof PlayerEntity && ((PlayerEntity) entity).isCreative())) { iterator.remove(); continue; } @@ -98,8 +104,10 @@ public class NozzleTileEntity extends SmartTileEntity { continue; float factor = (entity instanceof ItemEntity) ? 1 / 128f : 1 / 32f; - Vec3d pushVec = diff.normalize().scale((range - distance) * (pushing ? 1 : -1)); - entity.setMotion(entity.getMotion().add(pushVec.scale(factor))); + Vec3d pushVec = diff.normalize() + .scale((range - distance) * (pushing ? 1 : -1)); + entity.setMotion(entity.getMotion() + .add(pushVec.scale(factor))); entity.fallDistance = 0; entity.velocityChanged = true; } @@ -125,7 +133,8 @@ public class NozzleTileEntity extends SmartTileEntity { return 0; if (fan.getSpeed() == 0) return 0; - pushing = fan.getAirFlowDirection() == fan.getBlockState().get(EncasedFanBlock.FACING); + pushing = fan.getAirFlowDirection() == fan.getBlockState() + .get(EncasedFanBlock.FACING); return fan.getMaxDistance(); } @@ -140,11 +149,12 @@ public class NozzleTileEntity extends SmartTileEntity { AxisAlignedBB bb = new AxisAlignedBB(center, center).grow(range / 2f); for (Entity entity : world.getEntitiesWithinAABB(Entity.class, bb)) { - Vec3d diff = entity.getPositionVec().subtract(center); + Vec3d diff = entity.getPositionVec() + .subtract(center); double distance = diff.length(); if (distance > range || entity.isSneaking() - || (entity instanceof PlayerEntity && ((PlayerEntity) entity).isCreative())) { + || (entity instanceof PlayerEntity && ((PlayerEntity) entity).isCreative())) { continue; } @@ -164,7 +174,7 @@ public class NozzleTileEntity extends SmartTileEntity { continue; iterator.remove(); } - + if (!pushing && pushingEntities.size() > 256 && !world.isRemote) { world.createExplosion(null, center.x, center.y, center.z, 2, Mode.NONE); for (Iterator iterator = pushingEntities.iterator(); iterator.hasNext();) { @@ -178,8 +188,9 @@ public class NozzleTileEntity extends SmartTileEntity { private boolean canSee(Entity entity) { RayTraceContext context = new RayTraceContext(entity.getPositionVec(), VecHelper.getCenterOf(pos), - BlockMode.COLLIDER, FluidMode.NONE, entity); - return pos.equals(world.rayTraceBlocks(context).getPos()); + BlockMode.COLLIDER, FluidMode.NONE, entity); + return pos.equals(world.rayTraceBlocks(context) + .getPos()); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelTileEntity.java index c55e0ed0f..6c91f6d7e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelTileEntity.java @@ -53,30 +53,21 @@ public class FlywheelTileEntity extends GeneratingKineticTileEntity { } @Override - public CompoundNBT writeToClient(CompoundNBT compound) { - return super.writeToClient(compound); - } - - @Override - public void readClientUpdate(CompoundNBT tag) { - super.readClientUpdate(tag); - visualSpeed.withSpeed(1 / 32f).target(getGeneratedSpeed()); - } - - @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.putFloat("GeneratedSpeed", generatedSpeed); compound.putFloat("GeneratedCapacity", generatedCapacity); compound.putInt("Cooldown", stoppingCooldown); - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { generatedSpeed = compound.getFloat("GeneratedSpeed"); generatedCapacity = compound.getFloat("GeneratedCapacity"); stoppingCooldown = compound.getInt("Cooldown"); - super.read(compound); + super.read(compound, clientPacket); + if (clientPacket) + visualSpeed.withSpeed(1 / 32f).target(getGeneratedSpeed()); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java index 434c6883c..8e3bab94b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java @@ -116,19 +116,19 @@ public class MillstoneTileEntity extends KineticTileEntity { } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.putInt("Timer", timer); compound.put("InputInventory", inputInv.serializeNBT()); compound.put("OutputInventory", outputInv.serializeNBT()); - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { timer = compound.getInt("Timer"); inputInv.deserializeNBT(compound.getCompound("InputInventory")); outputInv.deserializeNBT(compound.getCompound("OutputInventory")); - super.read(compound); + super.read(compound, clientPacket); } public int getProcessingSpeed() { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java index a0086e9f5..409597272 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java @@ -109,17 +109,17 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity { } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { running = compound.getBoolean("Running"); runningTicks = compound.getInt("Ticks"); - super.read(compound); + super.read(compound, clientPacket); } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.putBoolean("Running", running); compound.putInt("Ticks", runningTicks); - return super.write(compound); + super.write(compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java index 94ffcfdd2..9091d4935 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java @@ -15,6 +15,7 @@ import com.simibubi.create.foundation.advancement.AllTriggers; import com.simibubi.create.foundation.item.ItemHelper; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.belt.BeltProcessingBehaviour; +import com.simibubi.create.foundation.utility.NBTHelper; import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.entity.Entity; @@ -25,7 +26,6 @@ import net.minecraft.item.crafting.ICraftingRecipe; import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.Ingredient; import net.minecraft.nbt.CompoundNBT; -import net.minecraft.nbt.ListNBT; import net.minecraft.particles.ItemParticleData; import net.minecraft.particles.ParticleTypes; import net.minecraft.tileentity.TileEntityType; @@ -85,37 +85,30 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity { } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { running = compound.getBoolean("Running"); mode = Mode.values()[compound.getInt("Mode")]; finished = compound.getBoolean("Finished"); runningTicks = compound.getInt("Ticks"); - super.read(compound); + super.read(compound, clientPacket); + + if (clientPacket) { + NBTHelper.iterateCompoundList(compound.getList("ParticleItems", NBT.TAG_COMPOUND), + c -> pressedItems.add(ItemStack.read(c))); + spawnParticles(); + } } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.putBoolean("Running", running); compound.putInt("Mode", mode.ordinal()); compound.putBoolean("Finished", finished); compound.putInt("Ticks", runningTicks); - return super.write(compound); - } + super.write(compound, clientPacket); - @Override - public CompoundNBT writeToClient(CompoundNBT tag) { - ListNBT particleItems = new ListNBT(); - pressedItems.forEach(stack -> particleItems.add(stack.serializeNBT())); - tag.put("ParticleItems", particleItems); - return super.writeToClient(tag); - } - - @Override - public void readClientUpdate(CompoundNBT tag) { - super.readClientUpdate(tag); - ListNBT particleItems = tag.getList("ParticleItems", NBT.TAG_COMPOUND); - particleItems.forEach(nbt -> pressedItems.add(ItemStack.read((CompoundNBT) nbt))); - spawnParticles(); + if (clientPacket) + compound.put("ParticleItems", NBTHelper.writeCompoundList(pressedItems, ItemStack::serializeNBT)); } @Override @@ -301,7 +294,8 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity { CombinedItemFluidList remaining = new CombinedItemFluidList(); inputs.forEachItemStack(stack -> remaining.add(stack.copy())); - basinFluidInv.ifPresent(fluidInv -> ((CombinedFluidHandler) fluidInv).forEachTank(fluidStack -> remaining.add(fluidStack.copy()))); + basinFluidInv.ifPresent( + fluidInv -> ((CombinedFluidHandler) fluidInv).forEachTank(fluidStack -> remaining.add(fluidStack.copy()))); Ingredients: for (Ingredient ingredient : ingredients) { for (ItemStack stack : remaining.getItemStacks()) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java index e127b162b..660a744a2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java @@ -94,15 +94,15 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity { } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.put("Inventory", inventory.serializeNBT()); compound.putInt("RecipeIndex", recipeIndex); - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT compound) { - super.read(compound); + protected void read(CompoundNBT compound, boolean clientPacket) { + super.read(compound, clientPacket); inventory.deserializeNBT(compound.getCompound("Inventory")); recipeIndex = compound.getInt("RecipeIndex"); } 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 236c6d5c3..edbd69c80 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 @@ -465,7 +465,7 @@ public abstract class Contraption { renderOrder.add(0, info.pos); CompoundNBT tag = info.nbt; MovementBehaviour movementBehaviour = AllMovementBehaviours.getMovementBehaviour(block); - if (tag == null || movementBehaviour == null || movementBehaviour.hasSpecialMovementRenderer()) + if (tag == null || (movementBehaviour != null && movementBehaviour.hasSpecialMovementRenderer())) return; tag.putInt("x", info.pos.getX()); @@ -797,7 +797,7 @@ public abstract class Contraption { Vec3d vec = new Vec3d(Direction.getFacingFromAxis(AxisDirection.POSITIVE, axis) .getDirectionVec()); - Vec3d planeByNormal = VecHelper.planeByNormal(vec); + Vec3d planeByNormal = VecHelper.axisAlingedPlaneOf(vec); Vec3d min = vec.mul(bb.minX, bb.minY, bb.minZ) .add(planeByNormal.scale(-maxDiff)); Vec3d max = vec.mul(bb.maxX, bb.maxY, bb.maxZ) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntity.java index f0d47fc0f..05ab6b777 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntity.java @@ -476,7 +476,7 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD BearingContraption bc = (BearingContraption) getContraption(); Direction facing = bc.getFacing(); Vec3d activeAreaOffset = actor.getActiveAreaOffset(context); - if (activeAreaOffset.mul(VecHelper.planeByNormal(new Vec3d(facing.getDirectionVec()))) + if (activeAreaOffset.mul(VecHelper.axisAlingedPlaneOf(new Vec3d(facing.getDirectionVec()))) .equals(Vec3d.ZERO)) { if (VecHelper.onSameAxis(blockInfo.pos, BlockPos.ZERO, facing.getAxis())) { context.motion = new Vec3d(facing.getDirectionVec()).scale(facing.getAxis() diff --git a/src/main/java/ContraptionInteractionHandler.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionInteractionHandler.java similarity index 94% rename from src/main/java/ContraptionInteractionHandler.java rename to src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionInteractionHandler.java index 2ad46f867..36ada9e88 100644 --- a/src/main/java/ContraptionInteractionHandler.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionInteractionHandler.java @@ -1,7 +1,6 @@ +package com.simibubi.create.content.contraptions.components.structureMovement; import org.apache.commons.lang3.mutable.MutableObject; -import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; -import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionEntity; import com.simibubi.create.content.contraptions.components.structureMovement.sync.ContraptionInteractionPacket; import com.simibubi.create.foundation.networking.AllPackets; import com.simibubi.create.foundation.utility.RaycastHelper; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkBearingTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkBearingTileEntity.java index d137d9c31..f610c284c 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkBearingTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkBearingTileEntity.java @@ -227,26 +227,26 @@ public class ClockworkBearingTileEntity extends KineticTileEntity implements IBe } @Override - public CompoundNBT write(CompoundNBT tag) { - tag.putBoolean("Running", running); - tag.putFloat("HourAngle", hourAngle); - tag.putFloat("MinuteAngle", minuteAngle); - return super.write(tag); + public void write(CompoundNBT compound, boolean clientPacket) { + compound.putBoolean("Running", running); + compound.putFloat("HourAngle", hourAngle); + compound.putFloat("MinuteAngle", minuteAngle); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT tag) { - running = tag.getBoolean("Running"); - hourAngle = tag.getFloat("HourAngle"); - minuteAngle = tag.getFloat("MinuteAngle"); - super.read(tag); - } - - @Override - public void readClientUpdate(CompoundNBT tag) { + protected void read(CompoundNBT compound, boolean clientPacket) { float hourAngleBefore = hourAngle; float minuteAngleBefore = minuteAngle; - super.readClientUpdate(tag); + + running = compound.getBoolean("Running"); + hourAngle = compound.getFloat("HourAngle"); + minuteAngle = compound.getFloat("MinuteAngle"); + super.read(compound, clientPacket); + + if (!clientPacket) + return; + if (running) { clientHourAngleDiff = AngleHelper.getShortestAngleDiff(hourAngleBefore, hourAngle); clientMinuteAngleDiff = AngleHelper.getShortestAngleDiff(minuteAngleBefore, minuteAngle); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java index 9a013ba7d..1f3713701 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java @@ -102,27 +102,25 @@ public class MechanicalBearingTileEntity extends GeneratingKineticTileEntity imp } @Override - public CompoundNBT write(CompoundNBT tag) { - tag.putBoolean("Running", running); - tag.putBoolean("Windmill", isWindmill); - tag.putFloat("Angle", angle); - tag.putFloat("LastGenerated", lastGeneratedSpeed); - return super.write(tag); + public void write(CompoundNBT compound, boolean clientPacket) { + compound.putBoolean("Running", running); + compound.putBoolean("Windmill", isWindmill); + compound.putFloat("Angle", angle); + compound.putFloat("LastGenerated", lastGeneratedSpeed); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT tag) { - running = tag.getBoolean("Running"); - isWindmill = tag.getBoolean("Windmill"); - angle = tag.getFloat("Angle"); - lastGeneratedSpeed = tag.getFloat("LastGenerated"); - super.read(tag); - } - - @Override - public void readClientUpdate(CompoundNBT tag) { + protected void read(CompoundNBT compound, boolean clientPacket) { float angleBefore = angle; - super.readClientUpdate(tag); + running = compound.getBoolean("Running"); + isWindmill = compound.getBoolean("Windmill"); + angle = compound.getFloat("Angle"); + lastGeneratedSpeed = compound.getFloat("LastGenerated"); + super.read(compound, clientPacket); + + if (!clientPacket) + return; if (running) { clientAngleDiff = AngleHelper.getShortestAngleDiff(angleBefore, angle); angle = angleBefore; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueItem.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueItem.java index 515aa8867..c86c4a61e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueItem.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueItem.java @@ -81,7 +81,7 @@ public class SuperGlueItem extends Item { @OnlyIn(Dist.CLIENT) public static void spawnParticles(World world, BlockPos pos, Direction direction, boolean fullBlock) { Vec3d vec = new Vec3d(direction.getDirectionVec()); - Vec3d plane = VecHelper.planeByNormal(vec); + Vec3d plane = VecHelper.axisAlingedPlaneOf(vec); Vec3d facePos = VecHelper.getCenterOf(pos) .add(vec.scale(.5f)); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueRenderer.java index 097daf419..4d8a1f381 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueRenderer.java @@ -6,6 +6,7 @@ import com.mojang.blaze3d.vertex.IVertexBuilder; import com.simibubi.create.AllItems; import com.simibubi.create.Create; import com.simibubi.create.foundation.utility.AngleHelper; +import com.simibubi.create.foundation.utility.MatrixStacker; import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.client.Minecraft; @@ -63,7 +64,9 @@ public class SuperGlueRenderer extends EntityRenderer { Direction face = entity.getFacingDirection(); ms.push(); - AngleHelper.applyRotation(face, ms); + MatrixStacker.of(ms) + .rotateY(AngleHelper.horizontalAngle(face)) + .rotateX(AngleHelper.verticalAngle(face)); Entry peek = ms.peek(); Vec3d[][] quads = { quad1, quad2 }; @@ -87,7 +90,7 @@ public class SuperGlueRenderer extends EntityRenderer { Vec3d diff = new Vec3d(Direction.SOUTH.getDirectionVec()); Vec3d extension = diff.normalize() .scale(1 / 32f - 1 / 128f); - Vec3d plane = VecHelper.planeByNormal(diff); + Vec3d plane = VecHelper.axisAlingedPlaneOf(diff); Axis axis = Direction.getFacingFromVector(diff.x, diff.y, diff.z) .getAxis(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/LinearActuatorTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/LinearActuatorTileEntity.java index b9c4ea478..c7148ec54 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/LinearActuatorTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/LinearActuatorTileEntity.java @@ -145,50 +145,38 @@ public abstract class LinearActuatorTileEntity extends KineticTileEntity impleme } @Override - public CompoundNBT write(CompoundNBT tag) { - tag.putBoolean("Running", running); - tag.putBoolean("Waiting", waitingForSpeedChange); - tag.putFloat("Offset", offset); - return super.write(tag); - } - - @Override - public CompoundNBT writeToClient(CompoundNBT compound) { - if (forceMove) { + protected void write(CompoundNBT compound, boolean clientPacket) { + compound.putBoolean("Running", running); + compound.putBoolean("Waiting", waitingForSpeedChange); + compound.putFloat("Offset", offset); + super.write(compound, clientPacket); + + if (clientPacket && forceMove) { compound.putBoolean("ForceMovement", forceMove); forceMove = false; } - return super.writeToClient(compound); } @Override - public void read(CompoundNBT tag) { - running = tag.getBoolean("Running"); - waitingForSpeedChange = tag.getBoolean("Waiting"); - offset = tag.getFloat("Offset"); - super.read(tag); - } - - @Override - public void readClientUpdate(CompoundNBT tag) { - boolean forceMovement = tag.contains("ForceMovement"); + protected void read(CompoundNBT compound, boolean clientPacket) { + boolean forceMovement = compound.contains("ForceMovement"); float offsetBefore = offset; - super.readClientUpdate(tag); - if (forceMovement) { - if (movedContraption != null) { - applyContraptionPosition(); - } - } else { - if (running) { - clientOffsetDiff = offset - offsetBefore; - offset = offsetBefore; - } + running = compound.getBoolean("Running"); + waitingForSpeedChange = compound.getBoolean("Waiting"); + offset = compound.getFloat("Offset"); + super.read(compound, clientPacket); + + if (!clientPacket) + return; + if (forceMovement) + applyContraptionPosition(); + else if (running) { + clientOffsetDiff = offset - offsetBefore; + offset = offsetBefore; } - if (!running) movedContraption = null; - } public abstract void disassemble(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java index 7433a9407..74720c617 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java @@ -29,15 +29,15 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity { } @Override - public void read(CompoundNBT tag) { - extensionLength = tag.getInt("ExtensionLength"); - super.read(tag); + protected void read(CompoundNBT compound, boolean clientPacket) { + extensionLength = compound.getInt("ExtensionLength"); + super.read(compound, clientPacket); } @Override - public CompoundNBT write(CompoundNBT tag) { + protected void write(CompoundNBT tag, boolean clientPacket) { tag.putInt("ExtensionLength", extensionLength); - return super.write(tag); + super.write(tag, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyTileEntity.java index 122d7be6c..04d0e1e81 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyTileEntity.java @@ -8,6 +8,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.pis import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.tileEntity.behaviour.CenteredSideValueBoxTransform; import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform; + import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.IWaterLoggable; @@ -168,15 +169,15 @@ public class PulleyTileEntity extends LinearActuatorTileEntity { } @Override - public void read(CompoundNBT tag) { - initialOffset = tag.getInt("InitialOffset"); - super.read(tag); + protected void read(CompoundNBT compound, boolean clientPacket) { + initialOffset = compound.getInt("InitialOffset"); + super.read(compound, clientPacket); } @Override - public CompoundNBT write(CompoundNBT tag) { - tag.putInt("InitialOffset", initialOffset); - return super.write(tag); + public void write(CompoundNBT compound, boolean clientPacket) { + compound.putInt("InitialOffset", initialOffset); + super.write(compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelTileEntity.java index 3232188ea..c7f39e7b9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelTileEntity.java @@ -24,8 +24,8 @@ public class WaterWheelTileEntity extends GeneratingKineticTileEntity { } @Override - public void read(CompoundNBT compound) { - super.read(compound); + protected void read(CompoundNBT compound, boolean clientPacket) { + super.read(compound, clientPacket); if (compound.contains("Flows")) { for (Direction d : Direction.values()) setFlow(d, compound.getCompound("Flows") @@ -39,13 +39,13 @@ public class WaterWheelTileEntity extends GeneratingKineticTileEntity { } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { CompoundNBT flows = new CompoundNBT(); for (Direction d : Direction.values()) flows.putFloat(d.getName(), this.flows.get(d)); compound.put("Flows", flows); - return super.write(compound); + super.write(compound, clientPacket); } public void setFlow(Direction direction, float speed) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/CombinedFluidHandler.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/CombinedFluidHandler.java index d7ae0d73b..9b03c90d2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/CombinedFluidHandler.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/CombinedFluidHandler.java @@ -87,17 +87,20 @@ public class CombinedFluidHandler implements IFluidHandler { @Nonnull @Override public FluidStack drain(int maxDrain, FluidAction action) { - FluidStack stack = new FluidStack(tanks[0].getFluid(), 0); for (int i = 0; i < tanks.length; i++) { - if (tanks[i].isFluidEqual(stack)) { + if (stack.isEmpty() || tanks[i].isFluidEqual(stack)) { int newDrainAmount = MathHelper.clamp(stack.getAmount() + tanks[i].getAmount(), 0, maxDrain); if (action == FluidAction.EXECUTE) { tanks[i].shrink(newDrainAmount - stack.getAmount()); if (tanks[i].isEmpty()) tanks[i] = FluidStack.EMPTY; } + if (stack.isEmpty()) + stack = tanks[i].copy(); + if (stack.isEmpty()) + continue; stack.setAmount(newDrainAmount); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidNetwork.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidNetwork.java new file mode 100644 index 000000000..0e9492909 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidNetwork.java @@ -0,0 +1,355 @@ +package com.simibubi.create.content.contraptions.fluids; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.google.common.collect.ImmutableList; +import com.simibubi.create.foundation.utility.BlockFace; +import com.simibubi.create.foundation.utility.Pair; + +import net.minecraft.block.BlockState; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Direction; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IWorld; +import net.minecraft.world.World; +import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.CapabilityFluidHandler; +import net.minecraftforge.fluids.capability.IFluidHandler; + +public class FluidNetwork { + + BlockFace pumpLocation; + Map>> pipeGraph; + List flows; + Set targets; + Set rangeEndpoints; + Map previousFlow; + + boolean connectToPumps; + int waitForUnloadedNetwork; + + public FluidNetwork() { + pipeGraph = new HashMap<>(); + flows = new ArrayList<>(); + targets = new HashSet<>(); + rangeEndpoints = new HashSet<>(); + previousFlow = new HashMap<>(); + } + + public boolean hasEndpoints() { + for (FluidNetworkFlow pipeFlow : flows) + if (pipeFlow.hasValidTargets()) + return true; + return false; + } + + public Collection getEndpoints(boolean pulling) { + if (!pulling) { + for (FluidNetworkFlow pipeFlow : flows) + return pipeFlow.outputEndpoints; + return Collections.emptySet(); + } + + List list = new ArrayList<>(); + for (FluidNetworkFlow pipeFlow : flows) { + if (!pipeFlow.hasValidTargets()) + continue; + list.add(pipeFlow.source); + } + return list; + } + + public void tick(IWorld world, PumpTileEntity pumpTE) { + if (connectToPumps) { + connectToOtherFNs(world, pumpTE); + connectToPumps = false; + } + } + + public void tickFlows(IWorld world, PumpTileEntity pumpTE, boolean pulling, float speed) { + if (connectToPumps) + return; + initFlows(pumpTE, pulling); + previousFlow.clear(); + flows.forEach(ep -> ep.tick(world, speed)); + } + + private void initFlows(PumpTileEntity pumpTE, boolean pulling) { + if (targets.isEmpty()) + return; + if (!flows.isEmpty()) + return; + World world = pumpTE.getWorld(); + if (pulling) { + targets.forEach(ne -> flows.add(new FluidNetworkFlow(this, ne, world, pulling))); + } else { + PumpEndpoint pumpEndpoint = new PumpEndpoint(pumpLocation.getOpposite(), pumpTE); + flows.add(new FluidNetworkFlow(this, pumpEndpoint, world, pulling)); + } + } + + public void connectToOtherFNs(IWorld world, PumpTileEntity pump) { + List> frontier = new ArrayList<>(); + Set visited = new HashSet<>(); + int maxDistance = FluidPropagator.getPumpRange() * 2; + frontier.add(Pair.of(-1, pumpLocation.getPos())); + + while (!frontier.isEmpty()) { + Pair entry = frontier.remove(0); + int distance = entry.getFirst(); + BlockPos currentPos = entry.getSecond(); + + if (!world.isAreaLoaded(currentPos, 0)) + continue; + if (visited.contains(currentPos)) + continue; + visited.add(currentPos); + + List connections; + if (currentPos.equals(pumpLocation.getPos())) { + connections = ImmutableList.of(pumpLocation.getFace()); + } else { + BlockState currentState = world.getBlockState(currentPos); + FluidPipeBehaviour pipe = FluidPropagator.getPipe(world, currentPos); + if (pipe == null) + continue; + connections = FluidPropagator.getPipeConnections(currentState, pipe); + } + + for (Direction face : connections) { + BlockFace blockFace = new BlockFace(currentPos, face); + BlockPos connectedPos = blockFace.getConnectedPos(); + BlockState connectedState = world.getBlockState(connectedPos); + + if (connectedPos.equals(pumpLocation.getPos())) + continue; + if (!world.isAreaLoaded(connectedPos, 0)) + continue; + if (PumpBlock.isPump(connectedState) && connectedState.get(PumpBlock.FACING) + .getAxis() == face.getAxis()) { + TileEntity tileEntity = world.getTileEntity(connectedPos); + if (tileEntity instanceof PumpTileEntity) { + PumpTileEntity otherPump = (PumpTileEntity) tileEntity; + if (otherPump.networks == null) + continue; + + otherPump.networks.forEach(fn -> { + int nearest = Integer.MAX_VALUE; + BlockFace argNearest = null; + for (BlockFace pumpEndpoint : fn.rangeEndpoints) { + if (pumpEndpoint.isEquivalent(pumpLocation)) { + argNearest = pumpEndpoint; + break; + } + Pair> pair = + pipeGraph.get(pumpEndpoint.getConnectedPos()); + if (pair == null) + continue; + Integer distanceFromPump = pair.getFirst(); + Map pipeConnections = pair.getSecond(); + + if (!pipeConnections.containsKey(pumpEndpoint.getOppositeFace())) + continue; + if (nearest <= distanceFromPump) + continue; + nearest = distanceFromPump; + argNearest = pumpEndpoint; + + } + if (argNearest != null) { + InterPumpEndpoint endpoint = new InterPumpEndpoint(world, argNearest.getOpposite(), + pump, otherPump, pumpLocation, fn.pumpLocation); + targets.add(endpoint); + fn.targets.add(endpoint.opposite(world)); + } + }); + + } + continue; + } + if (visited.contains(connectedPos)) + continue; + if (distance > maxDistance) + continue; + FluidPipeBehaviour targetPipe = FluidPropagator.getPipe(world, connectedPos); + if (targetPipe == null) + continue; + if (targetPipe.isConnectedTo(connectedState, face.getOpposite())) + frontier.add(Pair.of(distance + 1, connectedPos)); + } + } + + } + + public void assemble(IWorld world, PumpTileEntity pumpTE, BlockFace pumpLocation) { + Map openEnds = pumpTE.getOpenEnds(pumpLocation.getFace()); + openEnds.values() + .forEach(OpenEndedPipe::markStale); + + this.pumpLocation = pumpLocation; + if (!collectEndpoint(world, pumpLocation, openEnds, 0)) { + + List> frontier = new ArrayList<>(); + Set visited = new HashSet<>(); + int maxDistance = FluidPropagator.getPumpRange(); + frontier.add(Pair.of(0, pumpLocation.getConnectedPos())); + + while (!frontier.isEmpty()) { + Pair entry = frontier.remove(0); + int distance = entry.getFirst(); + BlockPos currentPos = entry.getSecond(); + + if (!world.isAreaLoaded(currentPos, 0)) + continue; + if (visited.contains(currentPos)) + continue; + visited.add(currentPos); + BlockState currentState = world.getBlockState(currentPos); + FluidPipeBehaviour pipe = FluidPropagator.getPipe(world, currentPos); + if (pipe == null) + continue; + + for (Direction face : FluidPropagator.getPipeConnections(currentState, pipe)) { + BlockFace blockFace = new BlockFace(currentPos, face); + BlockPos connectedPos = blockFace.getConnectedPos(); + + if (connectedPos.equals(pumpLocation.getPos())) { + addEntry(blockFace.getPos(), blockFace.getFace(), true, distance); + continue; + } + if (!world.isAreaLoaded(connectedPos, 0)) + continue; + if (collectEndpoint(world, blockFace, openEnds, distance)) + continue; + if (FluidPropagator.getPipe(world, connectedPos) == null) + continue; + if (visited.contains(connectedPos)) + continue; + if (distance + 1 >= maxDistance) { + rangeEndpoints.add(blockFace); + addEntry(currentPos, face, false, distance); + FluidPropagator.showBlockFace(blockFace) + .lineWidth(1 / 8f) + .colored(0xff0000); + continue; + } + + addConnection(connectedPos, currentPos, face.getOpposite(), distance); + frontier.add(Pair.of(distance + 1, connectedPos)); + } + } + } + + Set staleEnds = new HashSet<>(); + openEnds.entrySet() + .forEach(e -> { + if (e.getValue() + .isStale()) + staleEnds.add(e.getKey()); + }); + staleEnds.forEach(openEnds::remove); + + connectToPumps = true; + } + + private FluidNetworkEndpoint reuseOrCreateOpenEnd(IWorld world, Map openEnds, + BlockFace toCreate) { + OpenEndedPipe openEndedPipe = null; + if (openEnds.containsKey(toCreate)) { + openEndedPipe = openEnds.get(toCreate); + openEndedPipe.unmarkStale(); + } else { + openEndedPipe = new OpenEndedPipe(toCreate); + openEnds.put(toCreate, openEndedPipe); + } + return new FluidNetworkEndpoint(world, toCreate, openEndedPipe.getCapability()); + + } + + private boolean collectEndpoint(IWorld world, BlockFace blockFace, Map openEnds, + int distance) { + BlockPos connectedPos = blockFace.getConnectedPos(); + BlockState connectedState = world.getBlockState(connectedPos); + + // other pipe, no endpoint + FluidPipeBehaviour pipe = FluidPropagator.getPipe(world, connectedPos); + if (pipe != null && pipe.isConnectedTo(connectedState, blockFace.getOppositeFace())) + return false; + TileEntity tileEntity = world.getTileEntity(connectedPos); + + // fluid handler endpoint + Direction face = blockFace.getFace(); + if (tileEntity != null) { + LazyOptional capability = + tileEntity.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, face.getOpposite()); + if (capability.isPresent()) { + targets.add(new FluidNetworkEndpoint(world, blockFace, capability)); + addEntry(blockFace.getPos(), face, false, distance); + FluidPropagator.showBlockFace(blockFace) + .colored(0x00b7c2) + .lineWidth(1 / 8f); + return true; + } + } + + // open endpoint + if (PumpBlock.isPump(connectedState) && connectedState.get(PumpBlock.FACING) + .getAxis() == face.getAxis()) { + rangeEndpoints.add(blockFace); + addEntry(blockFace.getPos(), face, false, distance); + return true; + } + if (!FluidPropagator.isOpenEnd(world, blockFace.getPos(), face)) + return false; + + targets.add(reuseOrCreateOpenEnd(world, openEnds, blockFace)); + addEntry(blockFace.getPos(), face, false, distance); + FluidPropagator.showBlockFace(blockFace) + .colored(0xb700c2) + .lineWidth(1 / 8f); + return true; + } + + private void addConnection(BlockPos from, BlockPos to, Direction direction, int distance) { + addEntry(from, direction, true, distance); + addEntry(to, direction.getOpposite(), false, distance + 1); + } + + private void addEntry(BlockPos pos, Direction direction, boolean outbound, int distance) { + if (!pipeGraph.containsKey(pos)) + pipeGraph.put(pos, Pair.of(distance, new HashMap<>())); + pipeGraph.get(pos) + .getSecond() + .put(direction, outbound); + } + + public void reAssemble(IWorld world, PumpTileEntity pumpTE, BlockFace pumpLocation) { + rangeEndpoints.clear(); + targets.clear(); + pipeGraph.clear(); + assemble(world, pumpTE, pumpLocation); + } + + public void remove(IWorld world) { + clearFlows(world, false); + } + + public void clearFlows(IWorld world, boolean saveState) { + for (FluidNetworkFlow networkFlow : flows) { + if (!networkFlow.getFluidStack() + .isEmpty()) + networkFlow.addToSkippedConnections(world); + networkFlow.resetFlow(world); + } + flows.clear(); + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidNetworkEndpoint.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidNetworkEndpoint.java new file mode 100644 index 000000000..0dc2b25c2 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidNetworkEndpoint.java @@ -0,0 +1,168 @@ +package com.simibubi.create.content.contraptions.fluids; + +import java.lang.ref.WeakReference; + +import com.simibubi.create.foundation.utility.BlockFace; +import com.simibubi.create.foundation.utility.Couple; +import com.simibubi.create.foundation.utility.Iterate; +import com.simibubi.create.foundation.utility.Pair; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IWorld; +import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.CapabilityFluidHandler; +import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction; + +class FluidNetworkEndpoint { + BlockFace location; + protected LazyOptional handler; + + public FluidNetworkEndpoint(IWorld world, BlockFace location, LazyOptional handler) { + this.location = location; + this.handler = handler; + this.handler.addListener($ -> onHandlerInvalidated(world)); + } + + protected void onHandlerInvalidated(IWorld world) { + IFluidHandler tank = handler.orElse(null); + if (tank != null) + return; + TileEntity tileEntity = world.getTileEntity(location.getConnectedPos()); + if (tileEntity == null) + return; + LazyOptional capability = + tileEntity.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, location.getOppositeFace()); + if (capability.isPresent()) { + handler = capability; + handler.addListener($ -> onHandlerInvalidated(world)); + } + } + + public FluidStack provideFluid() { + IFluidHandler tank = provideHandler().orElse(null); + if (tank == null) + return FluidStack.EMPTY; + return tank.drain(1, FluidAction.SIMULATE); + } + + public LazyOptional provideHandler() { + return handler; + } + +} + +class PumpEndpoint extends FluidNetworkEndpoint { + + PumpTileEntity pumpTE; + + public PumpEndpoint(BlockFace location, PumpTileEntity pumpTE) { + super(pumpTE.getWorld(), location, LazyOptional.empty()); + this.pumpTE = pumpTE; + } + + @Override + protected void onHandlerInvalidated(IWorld world) {} + + @Override + public FluidStack provideFluid() { + return pumpTE.providedFluid; + } + +} + +class InterPumpEndpoint extends FluidNetworkEndpoint { + + Couple>> pumps; + + private InterPumpEndpoint(IWorld world, BlockFace location, LazyOptional handler) { + super(world, location, handler); + } + + public InterPumpEndpoint(IWorld world, BlockFace location, PumpTileEntity source, PumpTileEntity interfaced, + BlockFace sourcePos, BlockFace interfacedPos) { + this(world, location, LazyOptional.empty()); + handler = LazyOptional.of(() -> new InterPumpFluidHandler(this)); + pumps = Couple.create(Pair.of(sourcePos, new WeakReference<>(source)), + Pair.of(interfacedPos, new WeakReference<>(interfaced))); + } + + public InterPumpEndpoint opposite(IWorld world) { + InterPumpEndpoint interPumpEndpoint = new InterPumpEndpoint(world, this.location.getOpposite(), handler); + interPumpEndpoint.pumps = pumps.copy(); + return interPumpEndpoint; + } + + public Couple>> getPumps() { + return pumps; + } + + public boolean isPulling(boolean first) { + Pair> pair = getPumps().get(first); + PumpTileEntity pumpTileEntity = pair.getSecond() + .get(); + if (pumpTileEntity == null || pumpTileEntity.isRemoved()) + return false; + return pumpTileEntity.isPullingOnSide(pumpTileEntity.isFront(pair.getFirst() + .getFace())); + } + + public int getTransferSpeed(boolean first) { + PumpTileEntity pumpTileEntity = getPumps().get(first) + .getSecond() + .get(); + if (pumpTileEntity == null || pumpTileEntity.isRemoved()) + return 0; + return pumpTileEntity.getFluidTransferSpeed(); + } + + @Override + public LazyOptional provideHandler() { + if (isPulling(true) == isPulling(false)) + return LazyOptional.empty(); + if (getTransferSpeed(true) > getTransferSpeed(false)) + return LazyOptional.empty(); + return super.provideHandler(); + } + + @Override + public FluidStack provideFluid() { + if (!provideHandler().isPresent()) + return FluidStack.EMPTY; + + Couple>> pumps = getPumps(); + for (boolean current : Iterate.trueAndFalse) { + if (isPulling(current)) + continue; + + Pair> pair = pumps.get(current); + BlockFace blockFace = pair.getFirst(); + PumpTileEntity pumpTileEntity = pair.getSecond() + .get(); + if (pumpTileEntity == null) + continue; + if (pumpTileEntity.networks == null) + continue; + FluidNetwork fluidNetwork = pumpTileEntity.networks.get(pumpTileEntity.isFront(blockFace.getFace())); + for (FluidNetworkFlow fluidNetworkFlow : fluidNetwork.flows) { + for (FluidNetworkEndpoint fne : fluidNetworkFlow.outputEndpoints) { + if (!(fne instanceof InterPumpEndpoint)) + continue; + InterPumpEndpoint ipe = (InterPumpEndpoint) fne; + if (!ipe.location.isEquivalent(location)) + continue; + + FluidStack heldFluid = fluidNetworkFlow.fluidStack; + if (heldFluid.isEmpty()) + return heldFluid; + FluidStack copy = heldFluid.copy(); + copy.setAmount(1); + return heldFluid; + } + } + } + return FluidStack.EMPTY; + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidNetworkFlow.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidNetworkFlow.java new file mode 100644 index 000000000..9c861bb2e --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidNetworkFlow.java @@ -0,0 +1,304 @@ +package com.simibubi.create.content.contraptions.fluids; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; +import com.simibubi.create.foundation.utility.BlockFace; +import com.simibubi.create.foundation.utility.Iterate; + +import net.minecraft.block.BlockState; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Direction; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IWorld; +import net.minecraftforge.fluids.FluidStack; + +class FluidNetworkFlow { + + @FunctionalInterface + static interface PipeFlowConsumer { + void accept(FluidPipeBehaviour pipe, Direction face, boolean inbound); + } + + /** + * + */ + private final FluidNetwork activePipeNetwork; + FluidNetworkEndpoint source; + FluidStack fluidStack; + Set flowPointers; + + Set outputEndpoints; + boolean pumpReached; + + boolean pulling; + float speed; + + public FluidNetworkFlow(FluidNetwork activePipeNetwork, FluidNetworkEndpoint source, IWorld world, + boolean pulling) { + this.activePipeNetwork = activePipeNetwork; + this.source = source; + this.pulling = pulling; + flowPointers = new HashSet<>(); + outputEndpoints = new HashSet<>(); + fluidStack = FluidStack.EMPTY; + tick(world, 0); + } + + void resetFlow(IWorld world) { + fluidStack = FluidStack.EMPTY; + flowPointers.clear(); + outputEndpoints.clear(); + pumpReached = false; + forEachPipeFlow(world, (pipe, face, inbound) -> pipe.removeFlow(this, face, inbound)); + } + + void addToSkippedConnections(IWorld world) { + forEachPipeFlow(world, (pipe, face, inbound) -> { + if (!pipe.getFluid().isFluidEqual(fluidStack)) + return; + BlockFace blockFace = new BlockFace(pipe.getPos(), face); + this.activePipeNetwork.previousFlow.put(blockFace, pipe.getFluid()); + }); + } + + void forEachPipeFlow(IWorld world, FluidNetworkFlow.PipeFlowConsumer consumer) { + Set flowPointers = new HashSet<>(); + flowPointers.add(getSource()); + + // Update all branches of this flow, and create new ones if necessary + while (!flowPointers.isEmpty()) { + List toAdd = new ArrayList<>(); + for (Iterator iterator = flowPointers.iterator(); iterator.hasNext();) { + BlockFace flowPointer = iterator.next(); + BlockPos currentPos = flowPointer.getPos(); + FluidPipeBehaviour pipe = getPipeInTree(world, currentPos); + if (pipe == null) { + iterator.remove(); + continue; + } + Map directions = this.activePipeNetwork.pipeGraph.get(currentPos) + .getSecond(); + for (Entry entry : directions.entrySet()) { + boolean inbound = entry.getValue() != pulling; + Direction face = entry.getKey(); + if (inbound && face != flowPointer.getFace()) + continue; + consumer.accept(pipe, face, inbound); + if (inbound) + continue; + toAdd.add(new BlockFace(currentPos.offset(face), face.getOpposite())); + } + iterator.remove(); + } + flowPointers.addAll(toAdd); + } + } + + void tick(IWorld world, float speed) { + boolean skipping = speed == 0; + Map previousFlow = this.activePipeNetwork.previousFlow; + if (skipping && previousFlow.isEmpty()) + return; + + this.speed = speed; + FluidStack provideFluid = source.provideFluid(); + if (!fluidStack.isEmpty() && !fluidStack.isFluidEqual(provideFluid)) { + resetFlow(world); + return; + } + + fluidStack = provideFluid; + + // There is currently no unfinished flow being followed + if (flowPointers.isEmpty()) { + + // The fluid source has run out -> reset + if (fluidStack.isEmpty()) { + if (hasValidTargets()) + resetFlow(world); + return; + } + + // Keep the flows if all is well + if (hasValidTargets()) + return; + + // Start a new flow from or towards the pump + BlockFace source = getSource(); + if (tryConnectTo(world, source.getOpposite())) + return; + flowPointers.add(source); + } + + boolean skipped = false; + Set pausedPointers = new HashSet<>(); + + do { + skipped = false; + List toAdd = null; + + // Update all branches of this flow, and create new ones if necessary + for (Iterator iterator = flowPointers.iterator(); iterator.hasNext();) { + BlockFace flowPointer = iterator.next(); + BlockPos currentPos = flowPointer.getPos(); + + if (pausedPointers.contains(flowPointer)) + continue; + + FluidPipeBehaviour pipe = getPipeInTree(world, currentPos); + if (pipe == null) { + iterator.remove(); + continue; + } + + Map directions = this.activePipeNetwork.pipeGraph.get(currentPos) + .getSecond(); + boolean inboundComplete = false; + boolean allFlowsComplete = true; + BlockState state = world.getBlockState(currentPos); + + // First loop only inbound flows of a pipe to see if they have reached the + // center + for (boolean inboundPass : Iterate.trueAndFalse) { + if (!inboundPass && !inboundComplete) + break; + + // For all connections of the pipe tree of the pump + for (Entry entry : directions.entrySet()) { + Boolean awayFromPump = entry.getValue(); + Direction direction = entry.getKey(); + boolean inbound = awayFromPump != pulling; + + if (inboundPass && direction != flowPointer.getFace()) + continue; + if (!inboundPass && inbound) + continue; + if (!pipe.canTransferToward(fluidStack, state, direction, inbound)) + continue; + + BlockFace blockface = new BlockFace(currentPos, direction); + + if (!pipe.hasStartedFlow(this, direction, inbound)) + pipe.addFlow(this, direction, inbound, false); + if (skipping && canSkip(previousFlow, blockface)) { + pipe.skipFlow(direction, inbound); + FluidPropagator.showBlockFace(blockface) + .colored(0x0) + .lineWidth(1 / 8f); + skipped = true; + } + + if (!pipe.hasCompletedFlow(direction, inbound)) { + allFlowsComplete = false; + continue; + } + + if (inboundPass) { + inboundComplete = true; + continue; + } + + // Outward pass, check if any target was reached + tryConnectTo(world, blockface); + } + } + + if (!allFlowsComplete && !skipping) + continue; + + // Create a new flow branch at each outward pipe connection + for (Entry entry : directions.entrySet()) { + if (entry.getValue() != pulling) + continue; + Direction face = entry.getKey(); + BlockFace addedBlockFace = new BlockFace(currentPos.offset(face), face.getOpposite()); + if (skipping && !canSkip(previousFlow, addedBlockFace)) { + allFlowsComplete = false; + continue; + } + if (toAdd == null) + toAdd = new ArrayList<>(); + toAdd.add(addedBlockFace); + } + + if (!allFlowsComplete && skipping) { + pausedPointers.add(flowPointer); + continue; + } + + iterator.remove(); + + } // End of branch loop + + if (toAdd != null) + flowPointers.addAll(toAdd); + + } while (skipping && skipped); + } + + private boolean canSkip(Map previousFlow, BlockFace blockface) { + return previousFlow.containsKey(blockface) && previousFlow.get(blockface) + .isFluidEqual(fluidStack); + } + + private boolean tryConnectTo(IWorld world, BlockFace blockface) { + // Pulling flow, target is the pump + if (pulling) { + if (!this.activePipeNetwork.pumpLocation.getOpposite() + .equals(blockface)) + return false; + pumpReached = true; + TileEntity targetTE = world.getTileEntity(this.activePipeNetwork.pumpLocation.getPos()); + if (targetTE instanceof PumpTileEntity) + ((PumpTileEntity) targetTE).setProvidedFluid(fluidStack); + FluidPropagator.showBlockFace(this.activePipeNetwork.pumpLocation) + .colored(0x799351) + .lineWidth(1 / 8f); + return true; + } + + // Pushing flow, targets are the endpoints + for (FluidNetworkEndpoint networkEndpoint : this.activePipeNetwork.targets) { + if (!networkEndpoint.location.isEquivalent(blockface)) + continue; + outputEndpoints.add(networkEndpoint); + FluidPropagator.showBlockFace(blockface) + .colored(0x799351) + .lineWidth(1 / 8f); + return !(networkEndpoint instanceof InterPumpEndpoint); + } + + return false; + } + + private BlockFace getSource() { + return pulling ? source.location : this.activePipeNetwork.pumpLocation.getOpposite(); + } + + private FluidPipeBehaviour getPipeInTree(IWorld world, BlockPos currentPos) { + if (!world.isAreaLoaded(currentPos, 0)) + return null; + if (!this.activePipeNetwork.pipeGraph.containsKey(currentPos)) + return null; + return TileEntityBehaviour.get(world, currentPos, FluidPipeBehaviour.TYPE); + } + + boolean hasValidTargets() { + return pumpReached || !outputEndpoints.isEmpty(); + } + + public float getSpeed() { + return speed; + } + + public FluidStack getFluidStack() { + return fluidStack; + } +} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeAttachmentBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeAttachmentBehaviour.java new file mode 100644 index 000000000..71afd7cfb --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeAttachmentBehaviour.java @@ -0,0 +1,57 @@ +package com.simibubi.create.content.contraptions.fluids; + +import com.simibubi.create.foundation.tileEntity.SmartTileEntity; +import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; +import com.simibubi.create.foundation.tileEntity.behaviour.BehaviourType; + +import net.minecraft.block.BlockState; +import net.minecraft.util.Direction; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.ILightReader; + +public class FluidPipeAttachmentBehaviour extends TileEntityBehaviour { + + public static BehaviourType TYPE = new BehaviourType<>(); + + public AttachmentTypes getAttachment(ILightReader world, BlockPos pos, BlockState state, Direction direction) { + if (!isPipeConnectedTowards(state, direction)) + return AttachmentTypes.NONE; + + BlockPos offsetPos = pos.offset(direction); + BlockState facingState = world.getBlockState(offsetPos); + + if (facingState.getBlock() instanceof PumpBlock && facingState.get(PumpBlock.FACING) + .getAxis() == direction.getAxis()) + return AttachmentTypes.NONE; + + if (FluidPropagator.hasFluidCapability(facingState, world, offsetPos, direction)) + return AttachmentTypes.DRAIN; + + return AttachmentTypes.RIM; + } + + public boolean isPipeConnectedTowards(BlockState state, Direction direction) { + FluidPipeBehaviour fluidPipeBehaviour = TileEntityBehaviour.get(tileEntity, FluidPipeBehaviour.TYPE); + if (fluidPipeBehaviour == null) + return false; + return fluidPipeBehaviour.isConnectedTo(state, direction); + } + + public static enum AttachmentTypes { + NONE, RIM, DRAIN; + + public boolean hasModel() { + return this != NONE; + } + } + + public FluidPipeAttachmentBehaviour(SmartTileEntity te) { + super(te); + } + + @Override + public BehaviourType getType() { + return TYPE; + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeBehaviour.java new file mode 100644 index 000000000..3010fa403 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeBehaviour.java @@ -0,0 +1,524 @@ +package com.simibubi.create.content.contraptions.fluids; + +import java.util.HashSet; +import java.util.IdentityHashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Random; +import java.util.Set; + +import javax.annotation.Nullable; + +import com.simibubi.create.AllSpecialTextures; +import com.simibubi.create.CreateClient; +import com.simibubi.create.content.contraptions.KineticDebugger; +import com.simibubi.create.foundation.fluid.FluidHelper; +import com.simibubi.create.foundation.tileEntity.SmartTileEntity; +import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; +import com.simibubi.create.foundation.tileEntity.behaviour.BehaviourType; +import com.simibubi.create.foundation.utility.Couple; +import com.simibubi.create.foundation.utility.Iterate; +import com.simibubi.create.foundation.utility.LerpedFloat; +import com.simibubi.create.foundation.utility.LerpedFloat.Chaser; +import com.simibubi.create.foundation.utility.NBTHelper; +import com.simibubi.create.foundation.utility.Pair; +import com.simibubi.create.foundation.utility.VecHelper; + +import net.minecraft.block.BlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.fluid.Fluid; +import net.minecraft.fluid.Fluids; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.nbt.ListNBT; +import net.minecraft.particles.BlockParticleData; +import net.minecraft.particles.IParticleData; +import net.minecraft.particles.ParticleTypes; +import net.minecraft.util.Direction; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.common.util.Constants.NBT; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fml.DistExecutor; + +public abstract class FluidPipeBehaviour extends TileEntityBehaviour { + + public static BehaviourType TYPE = new BehaviourType<>(); + + // Direction -> (inboundflows{}, outwardflows{}) + Map> allFlows; + FluidStack fluid; + Couple collision; + + public FluidPipeBehaviour(SmartTileEntity te) { + super(te); + allFlows = new IdentityHashMap<>(); + fluid = FluidStack.EMPTY; + } + + @Override + public BehaviourType getType() { + return TYPE; + } + + public void notifyNetwork() { + FluidPropagator.propagateChangedPipe(this.getWorld(), tileEntity.getPos(), tileEntity.getBlockState()); + } + + public boolean canTransferToward(FluidStack fluid, BlockState state, Direction direction, boolean inbound) { + return isConnectedTo(state, direction); + } + + public abstract boolean isConnectedTo(BlockState state, Direction direction); + + public float getRimRadius(BlockState state, Direction direction) { + return 1 / 4f + 1 / 64f; + } + + public boolean hasStartedFlow(FluidNetworkFlow flow, Direction face, boolean inbound) { + return allFlows.containsKey(face) && allFlows.get(face) + .get(inbound) + .hasFlow(flow); + } + + public boolean hasCompletedFlow(Direction face, boolean inbound) { + return allFlows.containsKey(face) && allFlows.get(face) + .get(inbound) + .isCompleted(); + } + + @Override + public void write(CompoundNBT compound, boolean client) { + compound.put("Fluid", fluid.writeToNBT(new CompoundNBT())); + ListNBT flows = new ListNBT(); + for (Direction face : Iterate.directions) + for (boolean inbound : Iterate.trueAndFalse) { + LerpedFloat flowProgress = getFlowProgress(face, inbound); + if (flowProgress == null) + continue; + CompoundNBT nbt = new CompoundNBT(); + NBTHelper.writeEnum(nbt, "Face", face); + nbt.putBoolean("In", inbound); + PipeFlows pipeFlows = allFlows.get(face) + .get(inbound); + Set participants = pipeFlows.participants; + nbt.putBoolean("Silent", participants == null || participants.isEmpty()); + nbt.put("Progress", flowProgress.writeNBT()); + + if (client) + nbt.putFloat("Strength", pipeFlows.bestFlowStrength); + + flows.add(nbt); + } + compound.put("Flows", flows); + } + + @Override + public void read(CompoundNBT compound, boolean client) { + fluid = FluidStack.loadFluidStackFromNBT(compound.getCompound("Fluid")); + + if (client) { + for (Direction face : Iterate.directions) + if (allFlows.containsKey(face)) + allFlows.get(face) + .forEach(pf -> pf.progress = null); + } + + NBTHelper.iterateCompoundList(compound.getList("Flows", NBT.TAG_COMPOUND), nbt -> { + Direction face = NBTHelper.readEnum(nbt, "Face", Direction.class); + boolean inbound = nbt.getBoolean("In"); + LerpedFloat progress = createFlowProgress(0); + progress.readNBT(nbt.getCompound("Progress"), false); + addFlow(null, face, inbound, nbt.getBoolean("Silent")); + setFlowProgress(face, inbound, progress); + if (client) + setVisualFlowStrength(face, inbound, nbt.getFloat("Strength")); + }); + + if (!client) + return; + + for (Direction face : Iterate.directions) { + if (!allFlows.containsKey(face)) + return; + Couple couple = allFlows.get(face); + if (couple.get(true).progress == null && couple.get(false).progress == null) + allFlows.remove(face); + if (allFlows.isEmpty()) + clear(); + } + } + + public void addFlow(@Nullable FluidNetworkFlow flow, Direction face, boolean inbound, boolean silent) { + if (flow != null) { + FluidStack fluid = flow.getFluidStack(); + if (!this.fluid.isEmpty() && !fluid.isFluidEqual(this.fluid)) { + collision = Couple.create(this.fluid, fluid); + return; + } + this.fluid = fluid; + } + + if (!allFlows.containsKey(face)) { + allFlows.put(face, Couple.create(PipeFlows::new)); + if (inbound && !silent) + spawnSplashOnRim(face); + } + + if (flow != null) { + PipeFlows flows = allFlows.get(face) + .get(inbound); + flows.addFlow(flow); + contentsChanged(); + } + } + + public void removeFlow(FluidNetworkFlow flow, Direction face, boolean inbound) { + if (!allFlows.containsKey(face)) + return; + Couple couple = allFlows.get(face); + couple.get(inbound) + .removeFlow(flow); + contentsChanged(); + if (!couple.get(true) + .isActive() + && !couple.get(false) + .isActive()) + allFlows.remove(face); + if (allFlows.isEmpty()) + clear(); + } + + public void setVisualFlowStrength(Direction face, boolean inbound, float strength) { + if (!allFlows.containsKey(face)) + return; + allFlows.get(face) + .get(inbound).bestFlowStrength = strength; + } + + public void setFlowProgress(Direction face, boolean inbound, LerpedFloat progress) { + if (!allFlows.containsKey(face)) + return; + allFlows.get(face) + .get(inbound).progress = progress; + } + + public LerpedFloat getFlowProgress(Direction face, boolean inbound) { + if (!allFlows.containsKey(face)) + return null; + return allFlows.get(face) + .get(inbound).progress; + } + + public void skipFlow(Direction face, boolean inbound) { + if (!allFlows.containsKey(face)) + return; + Couple couple = allFlows.get(face); + couple.get(inbound) + .skip(); + } + + public void clear() { + allFlows.clear(); + fluid = FluidStack.EMPTY; + contentsChanged(); + } + + public void spawnParticles() { + DistExecutor.runWhenOn(Dist.CLIENT, () -> this::spawnParticlesInner); + } + + public void spawnSplashOnRim(Direction face) { + DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> spawnSplashOnRimInner(face)); + } + + public static final int MAX_PARTICLE_RENDER_DISTANCE = 20; + public static final int SPLASH_PARTICLE_AMOUNT = 1; + public static final float IDLE_PARTICLE_SPAWN_CHANCE = 1 / 800f; + public static final Random r = new Random(); + + @OnlyIn(Dist.CLIENT) + private void spawnParticlesInner() { + if (!isRenderEntityWithinDistance()) + return; + if (fluid.isEmpty()) + return; + + World world = Minecraft.getInstance().world; + BlockPos pos = tileEntity.getPos(); + BlockState state = world.getBlockState(pos); + + for (Direction face : Iterate.directions) { + boolean open = FluidPropagator.isOpenEnd(world, pos, face); + if (isConnectedTo(state, face)) { + if (open) { + spawnPouringLiquid(world, state, fluid, face, 1); + continue; + } + if (r.nextFloat() < IDLE_PARTICLE_SPAWN_CHANCE) + spawnRimParticles(world, state, fluid, face, 1); + } + } + } + + @OnlyIn(Dist.CLIENT) + private void spawnSplashOnRimInner(Direction face) { + if (!isRenderEntityWithinDistance()) + return; + if (fluid.isEmpty()) + return; + World world = Minecraft.getInstance().world; + BlockPos pos = tileEntity.getPos(); + BlockState state = world.getBlockState(pos); + spawnRimParticles(world, state, fluid, face, SPLASH_PARTICLE_AMOUNT); + } + + @OnlyIn(Dist.CLIENT) + private void spawnRimParticles(World world, BlockState state, FluidStack fluid, Direction side, int amount) { + BlockPos pos = tileEntity.getPos(); + if (FluidPropagator.isOpenEnd(world, pos, side)) { + spawnPouringLiquid(world, state, fluid, side, amount); + return; + } + + IParticleData particle = null; + if (FluidHelper.isWater(fluid.getFluid())) + particle = ParticleTypes.DRIPPING_WATER; + if (FluidHelper.isLava(fluid.getFluid())) + particle = ParticleTypes.DRIPPING_LAVA; + // TODO: Generic drip particle type for forge fluids + + if (particle == null) + return; + + float rimRadius = getRimRadius(state, side); + Vec3d directionVec = new Vec3d(side.getDirectionVec()); + + for (int i = 0; i < amount; i++) { + Vec3d vec = VecHelper.offsetRandomly(Vec3d.ZERO, r, 1) + .normalize(); + vec = VecHelper.clampComponentWise(vec, rimRadius) + .mul(VecHelper.axisAlingedPlaneOf(directionVec)) + .add(directionVec.scale(.45 + r.nextFloat() / 16f)); + Vec3d m = vec; + vec = vec.add(VecHelper.getCenterOf(pos)); + + world.addOptionalParticle(particle, vec.x, vec.y - 1 / 16f, vec.z, m.x, m.y, m.z); + } + } + + @OnlyIn(Dist.CLIENT) + private void spawnPouringLiquid(World world, BlockState state, FluidStack fluid, Direction side, int amount) { + IParticleData particle = new BlockParticleData(ParticleTypes.BLOCK, fluid.getFluid() + .getDefaultState() + .getBlockState()); + float rimRadius = getRimRadius(state, side); + Vec3d directionVec = new Vec3d(side.getDirectionVec()); + + Couple couple = allFlows.get(side); + if (couple == null) + return; + couple.forEachWithContext((flow, inbound) -> { + if (flow.progress == null) + return; + for (int i = 0; i < amount; i++) { + Vec3d vec = VecHelper.offsetRandomly(Vec3d.ZERO, r, rimRadius); + vec = vec.mul(VecHelper.axisAlingedPlaneOf(directionVec)) + .add(directionVec.scale(.5 + r.nextFloat() / 4f)); + Vec3d m = vec; + Vec3d centerOf = VecHelper.getCenterOf(tileEntity.getPos()); + vec = vec.add(centerOf); + if (inbound) { + vec = vec.add(m); + m = centerOf.add(directionVec.scale(.5)) + .subtract(vec) + .scale(3); + } + world.addOptionalParticle(particle, vec.x, vec.y - 1 / 16f, vec.z, m.x, m.y, m.z); + } + }); + + } + + @OnlyIn(Dist.CLIENT) + private boolean isRenderEntityWithinDistance() { + Entity renderViewEntity = Minecraft.getInstance() + .getRenderViewEntity(); + if (renderViewEntity == null) + return false; + Vec3d center = VecHelper.getCenterOf(tileEntity.getPos()); + if (renderViewEntity.getPositionVec() + .distanceTo(center) > MAX_PARTICLE_RENDER_DISTANCE) + return false; + return true; + } + + static AxisAlignedBB smallCenter = new AxisAlignedBB(BlockPos.ZERO).shrink(.25); + + @Override + public void tick() { + super.tick(); + boolean isRemote = getWorld().isRemote; + + allFlows.values() + .forEach(c -> c.forEach(pf -> pf.tick(isRemote))); + + if (isRemote) { + clientTick(); + return; + } + + if (collision != null) { + FluidReactions.handlePipeFlowCollision(getWorld(), tileEntity.getPos(), collision.getFirst(), + collision.getSecond()); + collision = null; + return; + } + } + + public Pair getStrogestFlow(Direction side) { + Couple couple = allFlows.get(side); + if (couple == null) + return null; + + PipeFlows in = couple.get(true); + PipeFlows out = couple.get(false); + Couple progress = couple.map(pf -> pf.progress); + boolean inboundStronger = false; + + if (in.isCompleted() != out.isCompleted()) { + inboundStronger = in.isCompleted(); + } else if ((progress.get(true) == null) != (progress.get(false) == null)) { + inboundStronger = progress.get(true) != null; + } else { + if (progress.get(true) != null) + inboundStronger = in.bestFlowStrength > out.bestFlowStrength; + } + + return Pair.of(inboundStronger, progress.get(inboundStronger)); + } + + private void clientTick() { + spawnParticles(); + + if (!KineticDebugger.isActive()) + return; + if (fluid.isEmpty()) + return; + for (Entry> entry : allFlows.entrySet()) { + Direction face = entry.getKey(); + Vec3d directionVec = new Vec3d(face.getDirectionVec()); + float size = 1 / 4f; + boolean extended = !isConnectedTo(tileEntity.getBlockState(), face.getOpposite()); + float length = extended ? .75f : .5f; + + entry.getValue() + .forEachWithContext((flow, inbound) -> { + if (flow.progress == null) + return; + float value = flow.progress.getValue(); + Vec3d start = directionVec.scale(inbound ? .5 : .5f - length); + Vec3d offset = directionVec.scale(length * (inbound ? -1 : 1)) + .scale(value); + + Vec3d scale = new Vec3d(1, 1, 1).subtract(directionVec.scale(face.getAxisDirection() + .getOffset())) + .scale(size); + AxisAlignedBB bb = + new AxisAlignedBB(start, start.add(offset)).offset(VecHelper.getCenterOf(tileEntity.getPos())) + .grow(scale.x, scale.y, scale.z); + + int color = 0x7fdbda; + if (!fluid.isEmpty()) { + Fluid fluid2 = fluid.getFluid(); + if (fluid2 == Fluids.WATER) + color = 0x1D4D9B; + if (fluid2 == Fluids.LAVA) + color = 0xFF773D; + } + + CreateClient.outliner.chaseAABB(Pair.of(this, face), bb) + .withFaceTexture(AllSpecialTextures.CUTOUT_CHECKERED) + .colored(color) + .lineWidth(1 / 16f); + }); + } + } + + private void contentsChanged() { + tileEntity.markDirty(); + tileEntity.sendData(); + } + + private LerpedFloat createFlowProgress(double speed) { + return LerpedFloat.linear() + .startWithValue(0) + .chase(1, speed, Chaser.LINEAR); + } + + public FluidStack getFluid() { + return fluid; + } + + class PipeFlows { + LerpedFloat progress; + Set participants; + float bestFlowStrength; + + void addFlow(FluidNetworkFlow flow) { + if (participants == null) + participants = new HashSet<>(); + participants.add(flow); + + if (progress == null) { + progress = createFlowProgress(flow.getSpeed()); + } + } + + boolean hasFlow(FluidNetworkFlow flow) { + return participants != null && participants.contains(flow); + } + + void tick(boolean onClient) { + if (progress == null) + return; + if (!onClient) { + if (participants == null) + return; + bestFlowStrength = 0; + for (FluidNetworkFlow networkFlow : participants) + bestFlowStrength = Math.max(bestFlowStrength, networkFlow.getSpeed()); + if (isCompleted()) + return; + if (progress.updateChaseSpeed(bestFlowStrength)) + contentsChanged(); + } + progress.tickChaser(); + } + + void skip() { + progress = LerpedFloat.linear() + .startWithValue(1); + } + + void removeFlow(FluidNetworkFlow flow) { + if (participants == null) + return; + participants.remove(flow); + } + + boolean isActive() { + return participants != null && !participants.isEmpty(); + } + + boolean isCompleted() { + return progress != null && progress.getValue() == 1; + } + + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeBlock.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeBlock.java deleted file mode 100644 index f3cc7c6de..000000000 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeBlock.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.simibubi.create.content.contraptions.fluids; - -import com.simibubi.create.foundation.utility.Iterate; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.block.IWaterLoggable; -import net.minecraft.block.SixWayBlock; -import net.minecraft.fluid.Fluids; -import net.minecraft.fluid.IFluidState; -import net.minecraft.item.BlockItemUseContext; -import net.minecraft.state.StateContainer.Builder; -import net.minecraft.state.properties.BlockStateProperties; -import net.minecraft.util.Direction; -import net.minecraft.util.Direction.Axis; -import net.minecraft.util.Direction.AxisDirection; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockReader; -import net.minecraft.world.ILightReader; -import net.minecraft.world.IWorld; -import net.minecraftforge.fluids.capability.CapabilityFluidHandler; - -import javax.annotation.Nullable; - -public class FluidPipeBlock extends SixWayBlock implements IWaterLoggable { - - public FluidPipeBlock(Properties properties) { - super(4 / 16f, properties); - this.setDefaultState(super.getDefaultState().with(BlockStateProperties.WATERLOGGED, false)); - } - - public static boolean isPipe(BlockState state) { - return state.getBlock() instanceof FluidPipeBlock; - } - - public static boolean isTank(BlockState state, IBlockReader world, BlockPos pos, Direction blockFace) { - return state.hasTileEntity() && world.getTileEntity(pos).getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, blockFace.getOpposite()).isPresent(); - } - - // TODO: more generic pipe connection handling. Ideally without marker interface - public static boolean canConnectTo(ILightReader world, BlockPos pos, BlockState neighbour, Direction blockFace) { - if (isPipe(neighbour) || isTank(neighbour, world, pos, blockFace)) - return true; - return neighbour.getBlock() instanceof PumpBlock && blockFace.getAxis() == neighbour.get(PumpBlock.FACING) - .getAxis(); - } - - public static boolean shouldDrawRim(ILightReader world, BlockPos pos, BlockState state, Direction direction) { - if (!isPipe(state)) - return false; - if (!state.get(FACING_TO_PROPERTY_MAP.get(direction))) - return false; - BlockPos offsetPos = pos.offset(direction); - BlockState facingState = world.getBlockState(offsetPos); - if (facingState.getBlock() instanceof PumpBlock && facingState.get(PumpBlock.FACING) - .getAxis() == direction.getAxis()) - return false; - if (!isPipe(facingState)) - return true; - if (!isCornerOrEndPipe(world, pos, state)) - return false; - if (isStraightPipe(world, offsetPos, facingState)) - return true; - if (!shouldDrawCasing(world, pos, state) && shouldDrawCasing(world, offsetPos, facingState)) - return true; - if (isCornerOrEndPipe(world, offsetPos, facingState)) - return direction.getAxisDirection() == AxisDirection.POSITIVE; - return false; - } - - public static boolean isCornerOrEndPipe(ILightReader world, BlockPos pos, BlockState state) { - return isPipe(state) && !isStraightPipe(world, pos, state) && !shouldDrawCasing(world, pos, state); - } - - public static boolean isStraightPipe(ILightReader world, BlockPos pos, BlockState state) { - if (!isPipe(state)) - return false; - boolean axisFound = false; - for (Axis axis : Iterate.axes) { - Direction d1 = Direction.getFacingFromAxis(AxisDirection.NEGATIVE, axis); - Direction d2 = Direction.getFacingFromAxis(AxisDirection.POSITIVE, axis); - if (state.get(FACING_TO_PROPERTY_MAP.get(d1)) && state.get(FACING_TO_PROPERTY_MAP.get(d2))) - if (axisFound) - return false; - else - axisFound = true; - } - return axisFound; - } - - public static boolean shouldDrawCasing(ILightReader world, BlockPos pos, BlockState state) { - if (!isPipe(state)) - return false; - for (Axis axis : Iterate.axes) { - int connections = 0; - for (Direction direction : Iterate.directions) - if (direction.getAxis() != axis && state.get(FACING_TO_PROPERTY_MAP.get(direction))) - connections++; - if (connections > 2) - return true; - } - return false; - } - - @Override - protected void fillStateContainer(Builder builder) { - builder.add(NORTH, EAST, SOUTH, WEST, UP, DOWN, BlockStateProperties.WATERLOGGED); - super.fillStateContainer(builder); - } - - @Override - public BlockState getStateForPlacement(BlockItemUseContext context) { - IFluidState ifluidstate = context.getWorld().getFluidState(context.getPos()); - return updateBlockState(getDefaultState(), context.getNearestLookingDirection(), null, context.getWorld(), - context.getPos()).with(BlockStateProperties.WATERLOGGED, Boolean.valueOf(ifluidstate.getFluid() == Fluids.WATER)); - } - - @Override - public BlockState updatePostPlacement(BlockState state, Direction direction, BlockState neighbourState, - IWorld world, BlockPos pos, BlockPos neighbourPos) { - if (state.get(BlockStateProperties.WATERLOGGED)) { - world.getPendingFluidTicks().scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); - } - return updateBlockState(state, direction, direction.getOpposite(), world, pos); - } - - public BlockState updateBlockState(BlockState state, Direction preferredDirection, @Nullable Direction ignore, - ILightReader world, BlockPos pos) { - // Update sides that are not ignored - for (Direction d : Iterate.directions) - if (d != ignore) - state = state.with(FACING_TO_PROPERTY_MAP.get(d), - canConnectTo(world, pos.offset(d), world.getBlockState(pos.offset(d)), d.getOpposite())); - - // See if it has enough connections - Direction connectedDirection = null; - for (Direction d : Iterate.directions) { - if (state.get(FACING_TO_PROPERTY_MAP.get(d))) { - if (connectedDirection != null) - return state; - connectedDirection = d; - } - } - - // Add opposite end if only one connection - if (connectedDirection != null) - return state.with(FACING_TO_PROPERTY_MAP.get(connectedDirection.getOpposite()), true); - - // Use preferred - return state.with(FACING_TO_PROPERTY_MAP.get(preferredDirection), true) - .with(FACING_TO_PROPERTY_MAP.get(preferredDirection.getOpposite()), true); - } - - @Override - public IFluidState getFluidState(BlockState state) { - return state.get(BlockStateProperties.WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : Fluids.EMPTY.getDefaultState(); - } -} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPropagator.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPropagator.java new file mode 100644 index 000000000..34fa74ea8 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPropagator.java @@ -0,0 +1,189 @@ +package com.simibubi.create.content.contraptions.fluids; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.apache.commons.lang3.mutable.MutableObject; + +import com.simibubi.create.AllBlocks; +import com.simibubi.create.CreateClient; +import com.simibubi.create.content.contraptions.fluids.pipes.AxisPipeBlock; +import com.simibubi.create.content.contraptions.fluids.pipes.FluidPipeBlock; +import com.simibubi.create.foundation.config.AllConfigs; +import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; +import com.simibubi.create.foundation.utility.BlockFace; +import com.simibubi.create.foundation.utility.Iterate; +import com.simibubi.create.foundation.utility.outliner.Outline.OutlineParams; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.FlowingFluidBlock; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Direction; +import net.minecraft.util.Direction.Axis; +import net.minecraft.util.Direction.AxisDirection; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.IWorld; +import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.fluids.capability.CapabilityFluidHandler; +import net.minecraftforge.fml.DistExecutor; + +public class FluidPropagator { + + public static Direction validateNeighbourChange(BlockState state, World world, BlockPos pos, Block otherBlock, + BlockPos neighborPos, boolean isMoving) { + if (world.isRemote) + return null; + if (otherBlock instanceof FluidPipeBlock) + return null; + if (otherBlock instanceof AxisPipeBlock) + return null; + if (otherBlock instanceof PumpBlock) + return null; + if (otherBlock instanceof FlowingFluidBlock) + return null; + if (!isStraightPipe(state)) + return null; + for (Direction d : Iterate.directions) { + if (!pos.offset(d) + .equals(neighborPos)) + continue; + return d; + } + return null; + } + + public static FluidPipeBehaviour getPipe(IBlockReader reader, BlockPos pos) { + return TileEntityBehaviour.get(reader, pos, FluidPipeBehaviour.TYPE); + } + + public static boolean isOpenEnd(IBlockReader reader, BlockPos pos, Direction side) { + BlockPos connectedPos = pos.offset(side); + BlockState connectedState = reader.getBlockState(connectedPos); + FluidPipeBehaviour pipe = FluidPropagator.getPipe(reader, connectedPos); + if (pipe != null && pipe.isConnectedTo(connectedState, side.getOpposite())) + return false; + if (PumpBlock.isPump(connectedState) && connectedState.get(PumpBlock.FACING) + .getAxis() == side.getAxis()) + return false; + if (Block.hasSolidSide(connectedState, reader, connectedPos, side.getOpposite())) + return false; + if (!(connectedState.getMaterial() + .isReplaceable() && connectedState.getBlockHardness(reader, connectedPos) != -1) + && !connectedState.has(BlockStateProperties.WATERLOGGED)) + return false; + return true; + } + + public static void propagateChangedPipe(IWorld world, BlockPos pipePos, BlockState pipeState) { + List frontier = new ArrayList<>(); + Set visited = new HashSet<>(); + + frontier.add(pipePos); + + // Visit all connected pumps to update their network + while (!frontier.isEmpty()) { + BlockPos currentPos = frontier.remove(0); + if (visited.contains(currentPos)) + continue; + visited.add(currentPos); + BlockState currentState = currentPos.equals(pipePos) ? pipeState : world.getBlockState(currentPos); + FluidPipeBehaviour pipe = getPipe(world, currentPos); + if (pipe == null) + continue; + for (Direction direction : getPipeConnections(currentState, pipe)) { + BlockPos target = currentPos.offset(direction); + if (!world.isAreaLoaded(target, 0)) + continue; + + TileEntity tileEntity = world.getTileEntity(target); + BlockState targetState = world.getBlockState(target); + if (tileEntity instanceof PumpTileEntity) { + if (!AllBlocks.MECHANICAL_PUMP.has(targetState) || targetState.get(PumpBlock.FACING) + .getAxis() != direction.getAxis()) + continue; + PumpTileEntity pump = (PumpTileEntity) tileEntity; + pump.updatePipesOnSide(direction.getOpposite()); + continue; + } + if (visited.contains(target)) + continue; + FluidPipeBehaviour targetPipe = getPipe(world, target); + if (targetPipe == null) + continue; + if (targetPipe.isConnectedTo(targetState, direction.getOpposite())) + frontier.add(target); + } + } + } + + public static List getPipeConnections(BlockState state, FluidPipeBehaviour pipe) { + List list = new ArrayList<>(); + for (Direction d : Iterate.directions) + if (pipe.isConnectedTo(state, d)) + list.add(d); + return list; + } + + public static int getPumpRange() { + return AllConfigs.SERVER.fluids.mechanicalPumpRange.get(); + } + + public static OutlineParams showBlockFace(BlockFace face) { + MutableObject params = new MutableObject<>(new OutlineParams()); + DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> { + Vec3d directionVec = new Vec3d(face.getFace() + .getDirectionVec()); + Vec3d scaleVec = directionVec.scale(-.25f * face.getFace() + .getAxisDirection() + .getOffset()); + directionVec = directionVec.scale(.5f); + params.setValue(CreateClient.outliner.showAABB(face, + FluidPropagator.smallCenter.offset(directionVec.add(new Vec3d(face.getPos()))) + .grow(scaleVec.x, scaleVec.y, scaleVec.z) + .grow(1 / 16f))); + }); + return params.getValue(); + } + + static AxisAlignedBB smallCenter = new AxisAlignedBB(BlockPos.ZERO).shrink(.25); + + public static boolean hasFluidCapability(BlockState state, IBlockReader world, BlockPos pos, Direction blockFace) { + return state.hasTileEntity() && world.getTileEntity(pos) + .getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, blockFace.getOpposite()) + .isPresent(); + } + + public static boolean isStraightPipe(BlockState state) { + if (state.getBlock() instanceof AxisPipeBlock) + return true; + if (!FluidPipeBlock.isPipe(state)) + return false; + boolean axisFound = false; + int connections = 0; + for (Axis axis : Iterate.axes) { + Direction d1 = Direction.getFacingFromAxis(AxisDirection.NEGATIVE, axis); + Direction d2 = Direction.getFacingFromAxis(AxisDirection.POSITIVE, axis); + boolean openAt1 = FluidPipeBlock.isOpenAt(state, d1); + boolean openAt2 = FluidPipeBlock.isOpenAt(state, d2); + if (openAt1) + connections++; + if (openAt2) + connections++; + if (openAt1 && openAt2) + if (axisFound) + return false; + else + axisFound = true; + } + return axisFound && connections == 2; + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidReactions.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidReactions.java new file mode 100644 index 000000000..c15d2a40a --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidReactions.java @@ -0,0 +1,37 @@ +package com.simibubi.create.content.contraptions.fluids; + +import com.simibubi.create.foundation.fluid.FluidHelper; +import com.simibubi.create.foundation.utility.BlockHelper; + +import net.minecraft.block.Blocks; +import net.minecraft.fluid.Fluid; +import net.minecraft.fluid.Fluids; +import net.minecraft.fluid.IFluidState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; + +public class FluidReactions { + + public static void handlePipeFlowCollision(World world, BlockPos pos, FluidStack fluid, FluidStack fluid2) { + Fluid f1 = fluid.getFluid(); + Fluid f2 = fluid2.getFluid(); + BlockHelper.destroyBlock(world, pos, 1); + if (f1 == Fluids.WATER && f2 == Fluids.LAVA || f2 == Fluids.WATER && f1 == Fluids.LAVA) + world.setBlockState(pos, Blocks.COBBLESTONE.getDefaultState()); + } + + public static void handlePipeSpillCollision(World world, BlockPos pos, Fluid pipeFluid, IFluidState worldFluid) { + Fluid pf = FluidHelper.convertToStill(pipeFluid); + Fluid wf = worldFluid.getFluid(); + if (pf == Fluids.WATER && wf == Fluids.LAVA) + world.setBlockState(pos, Blocks.OBSIDIAN.getDefaultState()); + if (pf == Fluids.WATER && wf == Fluids.FLOWING_LAVA) + world.setBlockState(pos, Blocks.COBBLESTONE.getDefaultState()); + else if (pf == Fluids.LAVA && wf == Fluids.WATER) + world.setBlockState(pos, Blocks.STONE.getDefaultState()); + else if (pf == Fluids.LAVA && wf == Fluids.FLOWING_WATER) + world.setBlockState(pos, Blocks.COBBLESTONE.getDefaultState()); + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/InterPumpFluidHandler.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/InterPumpFluidHandler.java new file mode 100644 index 000000000..34e0bd8e1 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/InterPumpFluidHandler.java @@ -0,0 +1,44 @@ +package com.simibubi.create.content.contraptions.fluids; + +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.templates.FluidTank; + +public class InterPumpFluidHandler extends FluidTank { + + InterPumpEndpoint endpoint; + + public InterPumpFluidHandler(InterPumpEndpoint endpoint) { + super(Integer.MAX_VALUE); + this.endpoint = endpoint; + } + + @Override + public int fill(FluidStack resource, FluidAction action) { + if (resource.isEmpty()) + return 0; + int maxInput = Math.min(resource.getAmount(), Math.max(getTransferCapacity() - getFluidAmount(), 0)); + FluidStack toInsert = resource.copy(); + toInsert.setAmount(maxInput); + FluidPropagator.showBlockFace(endpoint.location).colored(0x77d196).lineWidth(1/4f); + return super.fill(toInsert, action); + } + + @Override + public FluidStack drain(int maxDrain, FluidAction action) { + return super.drain(maxDrain, action); + } + + public FluidStack provide() { + FluidStack heldFluid = getFluid(); + if (heldFluid.isEmpty()) + return heldFluid; + FluidStack copy = heldFluid.copy(); + copy.setAmount(1); + return copy; + } + + private int getTransferCapacity() { + return Math.min(endpoint.getTransferSpeed(true), endpoint.getTransferSpeed(false)); + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/OpenEndedPipe.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/OpenEndedPipe.java new file mode 100644 index 000000000..29e89f1f9 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/OpenEndedPipe.java @@ -0,0 +1,172 @@ +package com.simibubi.create.content.contraptions.fluids; + +import javax.annotation.Nullable; + +import com.simibubi.create.foundation.utility.BlockFace; +import com.simibubi.create.foundation.utility.Iterate; + +import net.minecraft.block.BlockState; +import net.minecraft.block.FlowingFluidBlock; +import net.minecraft.fluid.Fluid; +import net.minecraft.fluid.Fluids; +import net.minecraft.fluid.IFluidState; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +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 OpenEndedPipe { + + World world; + + private OpenEndFluidHandler fluidHandler; + private BlockPos outputPos; + private boolean wasPulling; + private boolean stale; + + public OpenEndedPipe(BlockFace face) { + fluidHandler = new OpenEndFluidHandler(); + outputPos = face.getConnectedPos(); + } + + public void tick(World world, boolean pulling) { + this.world = world; + if (!world.isAreaLoaded(outputPos, 0)) + return; + if (pulling != wasPulling) { + if (pulling) + fluidHandler.clear(); + wasPulling = pulling; + } + + BlockState state = world.getBlockState(outputPos); + IFluidState fluidState = state.getFluidState(); + boolean waterlog = state.has(BlockStateProperties.WATERLOGGED); + + if (!waterlog && !state.getMaterial() + .isReplaceable()) + return; + + // TODO different pipe end types + if (pulling) { + if (fluidState.isEmpty() || !fluidState.isSource()) + return; + if (!fluidHandler.tryCollectFluid(fluidState.getFluid())) + return; + if (waterlog) { + world.setBlockState(outputPos, state.with(BlockStateProperties.WATERLOGGED, false), 3); + return; + } + world.setBlockState(outputPos, fluidState.getBlockState() + .with(FlowingFluidBlock.LEVEL, 14), 3); + return; + } + + Fluid providedFluid = fluidHandler.tryProvidingFluid(); + if (providedFluid == null) + return; + if (!fluidState.isEmpty() && fluidState.getFluid() != providedFluid) { + FluidReactions.handlePipeSpillCollision(world, outputPos, providedFluid, fluidState); + return; + } + if (fluidState.isSource()) + return; + if (waterlog) { + if (providedFluid.getFluid() != Fluids.WATER) + return; + world.setBlockState(outputPos, state.with(BlockStateProperties.WATERLOGGED, true), 3); + return; + } + world.setBlockState(outputPos, providedFluid.getDefaultState() + .getBlockState(), 3); + } + + public LazyOptional getCapability() { + return LazyOptional.of(() -> fluidHandler); + } + + public CompoundNBT writeToNBT(CompoundNBT compound) { + fluidHandler.writeToNBT(compound); + compound.putBoolean("Pulling", wasPulling); + return compound; + } + + public void readNBT(CompoundNBT compound) { + fluidHandler.readFromNBT(compound); + wasPulling = compound.getBoolean("Pulling"); + } + + public void markStale() { + stale = true; + } + + public void unmarkStale() { + stale = false; + } + + public boolean isStale() { + return stale; + } + + private class OpenEndFluidHandler extends FluidTank { + + public OpenEndFluidHandler() { + super(1500); + } + + @Override + public int fill(FluidStack resource, FluidAction action) { + // Never allow being filled when a source is attached + if (world == null) + return 0; + if (!world.isAreaLoaded(outputPos, 0)) + return 0; + if (resource.isEmpty()) + return 0; + BlockState state = world.getBlockState(outputPos); + IFluidState fluidState = state.getFluidState(); + if (!fluidState.isEmpty() && fluidState.getFluid() != resource.getFluid()) { + FluidReactions.handlePipeSpillCollision(world, outputPos, resource.getFluid(), fluidState); + return 0; + } + if (fluidState.isSource()) + return 0; + if (!(state.has(BlockStateProperties.WATERLOGGED) && resource.getFluid() == Fluids.WATER) + && !state.getMaterial() + .isReplaceable()) + return 0; + + // Never allow being filled above 1000 + FluidStack insertable = resource.copy(); + insertable.setAmount(Math.min(insertable.getAmount(), Math.max(1000 - getFluidAmount(), 0))); + return super.fill(insertable, action); + } + + public boolean tryCollectFluid(Fluid fluid) { + for (boolean simulate : Iterate.trueAndFalse) + if (super.fill(new FluidStack(fluid, 1000), + simulate ? FluidAction.SIMULATE : FluidAction.EXECUTE) != 1000) + return false; + return true; + } + + @Nullable + public Fluid tryProvidingFluid() { + Fluid fluid = getFluid().getFluid(); + for (boolean simulate : Iterate.trueAndFalse) + if (drain(1000, simulate ? FluidAction.SIMULATE : FluidAction.EXECUTE).getAmount() != 1000) + return null; + return fluid; + } + + public void clear() { + setFluid(FluidStack.EMPTY); + } + + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeModel.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/PipeAttachmentModel.java similarity index 64% rename from src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeModel.java rename to src/main/java/com/simibubi/create/content/contraptions/fluids/PipeAttachmentModel.java index dd78d40d6..715ccf946 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeModel.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/PipeAttachmentModel.java @@ -1,11 +1,15 @@ package com.simibubi.create.content.contraptions.fluids; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Random; import com.simibubi.create.AllBlockPartials; +import com.simibubi.create.content.contraptions.fluids.FluidPipeAttachmentBehaviour.AttachmentTypes; +import com.simibubi.create.content.contraptions.fluids.pipes.FluidPipeBlock; import com.simibubi.create.foundation.block.render.WrappedBakedModel; +import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.utility.Iterate; import net.minecraft.block.BlockState; @@ -18,19 +22,22 @@ import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.ModelDataMap; import net.minecraftforge.client.model.data.ModelProperty; -public class FluidPipeModel extends WrappedBakedModel { +public class PipeAttachmentModel extends WrappedBakedModel { private static ModelProperty PIPE_PROPERTY = new ModelProperty<>(); - public FluidPipeModel(IBakedModel template) { + public PipeAttachmentModel(IBakedModel template) { super(template); } @Override public IModelData getModelData(ILightReader world, BlockPos pos, BlockState state, IModelData tileData) { PipeModelData data = new PipeModelData(); - for (Direction d : Iterate.directions) - data.putRim(d, FluidPipeBlock.shouldDrawRim(world, pos, state, d)); + FluidPipeAttachmentBehaviour attachmentBehaviour = + TileEntityBehaviour.get(world, pos, FluidPipeAttachmentBehaviour.TYPE); + if (attachmentBehaviour != null) + for (Direction d : Iterate.directions) + data.putRim(d, attachmentBehaviour.getAttachment(world, pos, state, d)); data.setEncased(FluidPipeBlock.shouldDrawCasing(world, pos, state)); return new ModelDataMap.Builder().withInitial(PIPE_PROPERTY, data) .build(); @@ -41,8 +48,10 @@ public class FluidPipeModel extends WrappedBakedModel { List quads = super.getQuads(state, side, rand, data); if (data instanceof ModelDataMap) { ModelDataMap modelDataMap = (ModelDataMap) data; - if (modelDataMap.hasProperty(PIPE_PROPERTY)) + if (modelDataMap.hasProperty(PIPE_PROPERTY)) { + quads = new ArrayList<>(quads); addQuads(quads, state, side, rand, modelDataMap, modelDataMap.getData(PIPE_PROPERTY)); + } } return quads; } @@ -50,8 +59,9 @@ public class FluidPipeModel extends WrappedBakedModel { private void addQuads(List quads, BlockState state, Direction side, Random rand, IModelData data, PipeModelData pipeData) { for (Direction d : Iterate.directions) - if (pipeData.getRim(d)) - quads.addAll(AllBlockPartials.PIPE_RIMS.get(d) + if (pipeData.hasRim(d)) + quads.addAll(AllBlockPartials.PIPE_ATTACHMENTS.get(pipeData.getRim(d)) + .get(d) .get() .getQuads(state, side, rand, data)); if (pipeData.isEncased()) @@ -60,15 +70,15 @@ public class FluidPipeModel extends WrappedBakedModel { } private class PipeModelData { - boolean[] rims; + AttachmentTypes[] rims; boolean encased; public PipeModelData() { - rims = new boolean[6]; - Arrays.fill(rims, false); + rims = new AttachmentTypes[6]; + Arrays.fill(rims, AttachmentTypes.NONE); } - public void putRim(Direction face, boolean rim) { + public void putRim(Direction face, AttachmentTypes rim) { rims[face.getIndex()] = rim; } @@ -76,7 +86,11 @@ public class FluidPipeModel extends WrappedBakedModel { this.encased = encased; } - public boolean getRim(Direction face) { + public boolean hasRim(Direction face) { + return rims[face.getIndex()] != AttachmentTypes.NONE; + } + + public AttachmentTypes getRim(Direction face) { return rims[face.getIndex()]; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpBlock.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpBlock.java index 788dcee2f..9e707518a 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpBlock.java @@ -1,14 +1,24 @@ package com.simibubi.create.content.contraptions.fluids; +import java.util.Map; + +import org.apache.commons.lang3.mutable.MutableBoolean; + import com.simibubi.create.AllShapes; import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.DirectionalKineticBlock; +import com.simibubi.create.content.contraptions.fluids.pipes.FluidPipeBlock; +import com.simibubi.create.foundation.utility.BlockFace; +import com.simibubi.create.foundation.utility.Iterate; + import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.IWaterLoggable; import net.minecraft.fluid.Fluids; import net.minecraft.fluid.IFluidState; import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.ItemUseContext; +import net.minecraft.network.DebugPacketSender; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; @@ -20,71 +30,137 @@ import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorld; import net.minecraft.world.IWorldReader; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; public class PumpBlock extends DirectionalKineticBlock implements IWaterLoggable { - public PumpBlock(Properties p_i48415_1_) { - super(p_i48415_1_); - setDefaultState(super.getDefaultState().with(BlockStateProperties.WATERLOGGED, false)); - } + public PumpBlock(Properties p_i48415_1_) { + super(p_i48415_1_); + setDefaultState(super.getDefaultState().with(BlockStateProperties.WATERLOGGED, false)); + } - @Override - public boolean hasTileEntity(BlockState state) { - return true; - } + @Override + public boolean hasTileEntity(BlockState state) { + return true; + } - @Override - public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return AllTileEntities.MECHANICAL_PUMP.create(); - } + @Override + public TileEntity createTileEntity(BlockState state, IBlockReader world) { + return AllTileEntities.MECHANICAL_PUMP.create(); + } - @Override - public BlockState getRotatedBlockState(BlockState originalState, Direction targetedFace) { - return originalState.with(FACING, originalState.get(FACING) - .getOpposite()); - } + @Override + public BlockState getRotatedBlockState(BlockState originalState, Direction targetedFace) { + return originalState.with(FACING, originalState.get(FACING) + .getOpposite()); + } - @Override - public Axis getRotationAxis(BlockState state) { - return state.get(FACING) - .getAxis(); - } + @Override + public BlockState updateAfterWrenched(BlockState newState, ItemUseContext context) { + BlockState state = super.updateAfterWrenched(newState, context); + World world = context.getWorld(); + BlockPos pos = context.getPos(); + if (world.isRemote) + return state; + TileEntity tileEntity = world.getTileEntity(pos); + if (!(tileEntity instanceof PumpTileEntity)) + return state; + PumpTileEntity pump = (PumpTileEntity) tileEntity; + if (pump.networks == null) + return state; - @Override - public VoxelShape getShape(BlockState state, IBlockReader p_220053_2_, BlockPos p_220053_3_, - ISelectionContext p_220053_4_) { - return AllShapes.PUMP.get(state.get(FACING)); - } + FluidNetwork apn1 = pump.networks.get(true); + FluidNetwork apn2 = pump.networks.get(false); - @Override - public boolean hasIntegratedCogwheel(IWorldReader world, BlockPos pos, BlockState state) { - return true; - } + // Collect pipes that can be skipped + apn1.clearFlows(world, true); + apn2.clearFlows(world, true); - @Override - public IFluidState getFluidState(BlockState state) { - return state.get(BlockStateProperties.WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : Fluids.EMPTY.getDefaultState(); - } + // Swap skipsets as the networks change sides + Map skippedConnections = apn1.previousFlow; + apn1.previousFlow = apn2.previousFlow; + apn2.previousFlow = skippedConnections; - @Override - protected void fillStateContainer(Builder builder) { - builder.add(BlockStateProperties.WATERLOGGED); - super.fillStateContainer(builder); - } + // Init networks next tick + pump.networksToUpdate.forEach(MutableBoolean::setTrue); + pump.networks.swap(); + pump.reversed = !pump.reversed; - @Override - public BlockState updatePostPlacement(BlockState state, Direction direction, BlockState neighbourState, - IWorld world, BlockPos pos, BlockPos neighbourPos) { - if (state.get(BlockStateProperties.WATERLOGGED)) { - world.getPendingFluidTicks().scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); - } - return state; - } + return state; + } - @Override - public BlockState getStateForPlacement(BlockItemUseContext context) { - IFluidState ifluidstate = context.getWorld().getFluidState(context.getPos()); - return super.getStateForPlacement(context).with(BlockStateProperties.WATERLOGGED, Boolean.valueOf(ifluidstate.getFluid() == Fluids.WATER)); - } + @Override + public Axis getRotationAxis(BlockState state) { + return state.get(FACING) + .getAxis(); + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader p_220053_2_, BlockPos p_220053_3_, + ISelectionContext p_220053_4_) { + return AllShapes.PUMP.get(state.get(FACING)); + } + + @Override + public boolean hasIntegratedCogwheel(IWorldReader world, BlockPos pos, BlockState state) { + return true; + } + + @Override + public void neighborChanged(BlockState state, World world, BlockPos pos, Block otherBlock, BlockPos neighborPos, + boolean isMoving) { + DebugPacketSender.func_218806_a(world, pos); + if (world.isRemote) + return; + if (otherBlock instanceof FluidPipeBlock) + return; + TileEntity tileEntity = world.getTileEntity(pos); + if (!(tileEntity instanceof PumpTileEntity)) + return; + PumpTileEntity pump = (PumpTileEntity) tileEntity; + Direction facing = state.get(FACING); + for (boolean front : Iterate.trueAndFalse) { + Direction side = front ? facing : facing.getOpposite(); + if (!pos.offset(side) + .equals(neighborPos)) + continue; + pump.updatePipesOnSide(side); + } + } + + @Override + public IFluidState getFluidState(BlockState state) { + return state.get(BlockStateProperties.WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) + : Fluids.EMPTY.getDefaultState(); + } + + @Override + protected void fillStateContainer(Builder builder) { + builder.add(BlockStateProperties.WATERLOGGED); + super.fillStateContainer(builder); + } + + @Override + public BlockState updatePostPlacement(BlockState state, Direction direction, BlockState neighbourState, + IWorld world, BlockPos pos, BlockPos neighbourPos) { + if (state.get(BlockStateProperties.WATERLOGGED)) { + world.getPendingFluidTicks() + .scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + } + return state; + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + IFluidState ifluidstate = context.getWorld() + .getFluidState(context.getPos()); + return super.getStateForPlacement(context).with(BlockStateProperties.WATERLOGGED, + Boolean.valueOf(ifluidstate.getFluid() == Fluids.WATER)); + } + + public static boolean isPump(BlockState state) { + return state.getBlock() instanceof PumpBlock; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpRenderer.java index 34e46dfb2..579445cb8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpRenderer.java @@ -31,7 +31,7 @@ public class PumpRenderer extends KineticTileEntityRenderer { PumpTileEntity pump = (PumpTileEntity) te; Vec3d rotationOffset = new Vec3d(.5, 14 / 16f, .5); BlockState blockState = te.getBlockState(); - float angle = MathHelper.lerp(pump.arrowDirection.get(partialTicks), 0, 90) - 90; + float angle = MathHelper.lerp(pump.arrowDirection.getValue(partialTicks), 0, 90) - 90; for (float yRot : new float[] { 0, 90 }) { ms.push(); SuperByteBuffer arrow = AllBlockPartials.MECHANICAL_PUMP_ARROW.renderOn(blockState); diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpTileEntity.java index 02f00736e..2e83cfd4b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpTileEntity.java @@ -1,29 +1,380 @@ package com.simibubi.create.content.contraptions.fluids; -import com.simibubi.create.content.contraptions.base.KineticTileEntity; -import com.simibubi.create.foundation.gui.widgets.InterpolatedChasingValue; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import org.apache.commons.lang3.mutable.MutableBoolean; + +import com.simibubi.create.content.contraptions.base.KineticTileEntity; +import com.simibubi.create.foundation.tileEntity.SmartTileEntity; +import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; +import com.simibubi.create.foundation.utility.BlockFace; +import com.simibubi.create.foundation.utility.Couple; +import com.simibubi.create.foundation.utility.Iterate; +import com.simibubi.create.foundation.utility.LerpedFloat; +import com.simibubi.create.foundation.utility.LerpedFloat.Chaser; +import com.simibubi.create.foundation.utility.NBTHelper; + +import net.minecraft.block.BlockState; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.nbt.ListNBT; import net.minecraft.tileentity.TileEntityType; +import net.minecraft.util.Direction; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.ILightReader; +import net.minecraftforge.common.util.Constants.NBT; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction; public class PumpTileEntity extends KineticTileEntity { - InterpolatedChasingValue arrowDirection; + LerpedFloat arrowDirection; + Couple networks; + Couple> openEnds; + Couple networksToUpdate; + + boolean reversed; + FluidStack providedFluid; public PumpTileEntity(TileEntityType typeIn) { super(typeIn); - arrowDirection = new InterpolatedChasingValue(); - arrowDirection.start(1); + arrowDirection = LerpedFloat.linear() + .startWithValue(1); + networksToUpdate = Couple.create(MutableBoolean::new); + openEnds = Couple.create(HashMap::new); + setProvidedFluid(FluidStack.EMPTY); + } + + @Override + public void addBehaviours(List behaviours) { + super.addBehaviours(behaviours); + behaviours.add(new PumpAttachmentBehaviour(this)); + } + + @Override + public void initialize() { + super.initialize(); + reversed = getSpeed() < 0; } @Override public void tick() { super.tick(); + float speed = getSpeed(); + if (world.isRemote) { - float speed = getSpeed(); - if (speed != 0) - arrowDirection.target(Math.signum(speed)); - arrowDirection.tick(); + if (speed == 0) + return; + arrowDirection.chase(speed >= 0 ? 1 : -1, .5f, Chaser.EXP); + arrowDirection.tickChaser(); + return; + } + + BlockState blockState = getBlockState(); + if (!(blockState.getBlock() instanceof PumpBlock)) + return; + Direction face = blockState.get(PumpBlock.FACING); + MutableBoolean networkUpdated = new MutableBoolean(false); + + if (networks == null) { + networks = Couple.create(new FluidNetwork(), new FluidNetwork()); + networks.forEachWithContext((fn, front) -> { + BlockFace blockFace = new BlockFace(pos, front ? face : face.getOpposite()); + fn.assemble(world, this, blockFace); + FluidPropagator.showBlockFace(blockFace) + .lineWidth(1 / 8f); + }); + networkUpdated.setTrue(); + } + + networksToUpdate.forEachWithContext((update, front) -> { + if (update.isFalse()) + return; + FluidNetwork activePipeNetwork = networks.get(front); + if (activePipeNetwork == null) + return; + BlockFace blockFace = new BlockFace(pos, front ? face : face.getOpposite()); + activePipeNetwork.reAssemble(world, this, blockFace); + FluidPropagator.showBlockFace(blockFace) + .lineWidth(1 / 8f); + update.setFalse(); + networkUpdated.setTrue(); + }); + + if (networkUpdated.isTrue()) + return; + + networks.forEach(fn -> fn.tick(world, this)); + + if (speed == 0) + return; + if (speed < 0 != reversed) { + networks.forEachWithContext((fn, current) -> fn.clearFlows(world, true)); + reversed = speed < 0; + return; + } + + boolean pullingSide = isPullingOnSide(true); + float flowSpeed = Math.abs(speed) / 256f; + + networks.forEachWithContext((fn, front) -> { + boolean pulling = isPullingOnSide(front); + fn.tickFlows(world, this, pulling, flowSpeed); + openEnds.get(front) + .values() + .forEach(oep -> oep.tick(world, pulling)); + }); + + if (!networks.get(pullingSide) + .hasEndpoints()) { + setProvidedFluid(FluidStack.EMPTY); + return; + } + + if (networks.getFirst() + .hasEndpoints() + && networks.getSecond() + .hasEndpoints()) { + performTransfer(); + } + + } + + @Override + public void remove() { + super.remove(); + if (networks != null) + networks.forEachWithContext((fn, current) -> fn.clearFlows(world, false)); + } + + private void performTransfer() { + boolean input = isPullingOnSide(true); + Collection inputs = networks.get(input) + .getEndpoints(true); + Collection outputs = networks.get(!input) + .getEndpoints(false); + + int flowSpeed = getFluidTransferSpeed(); + FluidStack transfer = FluidStack.EMPTY; + for (boolean simulate : Iterate.trueAndFalse) { + FluidAction action = simulate ? FluidAction.SIMULATE : FluidAction.EXECUTE; + + List availableInputs = new ArrayList<>(inputs); + while (!availableInputs.isEmpty() && transfer.getAmount() < flowSpeed) { + int diff = flowSpeed - transfer.getAmount(); + int dividedTransfer = diff / availableInputs.size(); + int remainder = diff % availableInputs.size(); + + for (Iterator iterator = availableInputs.iterator(); iterator.hasNext();) { + int toTransfer = dividedTransfer; + if (remainder > 0) { + toTransfer++; + remainder--; + } + + FluidNetworkEndpoint ne = iterator.next(); + IFluidHandler handler = ne.provideHandler() + .orElse(null); + if (handler == null) { + iterator.remove(); + continue; + } + FluidStack drained = handler.drain(toTransfer, action); + if (drained.isEmpty()) { + iterator.remove(); + continue; + } + if (transfer.isFluidEqual(drained) || transfer.isEmpty()) { + if (drained.getAmount() < toTransfer) + iterator.remove(); + FluidStack copy = drained.copy(); + copy.setAmount(drained.getAmount() + transfer.getAmount()); + transfer = copy; + continue; + } + iterator.remove(); + continue; + } + + } + + List availableOutputs = new ArrayList<>(outputs); + while (!availableOutputs.isEmpty() && transfer.getAmount() > 0) { + int dividedTransfer = transfer.getAmount() / availableOutputs.size(); + int remainder = transfer.getAmount() % availableOutputs.size(); + + for (Iterator iterator = availableOutputs.iterator(); iterator.hasNext();) { + FluidNetworkEndpoint ne = iterator.next(); + int toTransfer = dividedTransfer; + if (remainder > 0) { + toTransfer++; + remainder--; + } + + if (transfer.isEmpty()) + break; + IFluidHandler handler = ne.provideHandler() + .orElse(null); + if (handler == null) { + iterator.remove(); + continue; + } + + FluidStack divided = transfer.copy(); + divided.setAmount(toTransfer); + int fill = handler.fill(divided, action); + transfer.setAmount(transfer.getAmount() - fill); + if (fill < toTransfer) + iterator.remove(); + } + + } + + flowSpeed -= transfer.getAmount(); + transfer = FluidStack.EMPTY; } } + public int getFluidTransferSpeed() { + float rotationSpeed = Math.abs(getSpeed()); + int flowSpeed = (int) (rotationSpeed / 2f); + if (rotationSpeed != 0 && flowSpeed == 0) + flowSpeed = 1; + return flowSpeed; + } + + @Override + public void write(CompoundNBT compound, boolean clientPacket) { + compound.putBoolean("Reversed", reversed); + serializeOpenEnds(compound); + super.write(compound, clientPacket); + } + + @Override + protected void read(CompoundNBT compound, boolean clientPacket) { + reversed = compound.getBoolean("Reversed"); + deserializeOpenEnds(compound); + super.read(compound, clientPacket); + } + + public void updatePipesOnSide(Direction side) { + if (!isSideAccessible(side)) + return; + updatePipeNetwork(isFront(side)); + } + + protected boolean isFront(Direction side) { + if (networks == null) + return false; + BlockState blockState = getBlockState(); + if (!(blockState.getBlock() instanceof PumpBlock)) + return false; + Direction front = blockState.get(PumpBlock.FACING); + boolean isFront = side == front; + return isFront; + } + + protected void updatePipeNetwork(boolean front) { + if (networks != null) + networks.get(front) + .clearFlows(world, true); + networksToUpdate.get(front) + .setTrue(); + if (getSpeed() == 0 || (isPullingOnSide(front)) && networks != null) + setProvidedFluid(FluidStack.EMPTY); + } + + public boolean isSideAccessible(Direction side) { + BlockState blockState = getBlockState(); + if (!(blockState.getBlock() instanceof PumpBlock)) + return false; + return blockState.get(PumpBlock.FACING) + .getAxis() == side.getAxis(); + } + + public boolean isPullingOnSide(boolean front) { + return front == reversed; + } + + public Map getOpenEnds(Direction side) { + return openEnds.get(isFront(side)); + } + + private void serializeOpenEnds(CompoundNBT compound) { + compound.put("OpenEnds", openEnds.serializeEach(m -> { + CompoundNBT compoundNBT = new CompoundNBT(); + ListNBT entries = new ListNBT(); + m.entrySet() + .forEach(e -> { + CompoundNBT innerCompound = new CompoundNBT(); + innerCompound.put("Pos", e.getKey() + .serializeNBT()); + e.getValue() + .writeToNBT(innerCompound); + entries.add(innerCompound); + }); + compoundNBT.put("Entries", entries); + return compoundNBT; + })); + } + + private void deserializeOpenEnds(CompoundNBT compound) { + openEnds = Couple.deserializeEach(compound.getList("OpenEnds", NBT.TAG_COMPOUND), c -> { + Map map = new HashMap<>(); + NBTHelper.iterateCompoundList(c.getList("Entries", NBT.TAG_COMPOUND), innerCompound -> { + BlockFace key = BlockFace.fromNBT(innerCompound.getCompound("Pos")); + OpenEndedPipe value = new OpenEndedPipe(key); + value.readNBT(innerCompound); + map.put(key, value); + }); + return map; + }); + + compound.put("OpenEnds", openEnds.serializeEach(m -> { + CompoundNBT compoundNBT = new CompoundNBT(); + ListNBT entries = new ListNBT(); + m.entrySet() + .forEach(e -> { + CompoundNBT innerCompound = new CompoundNBT(); + innerCompound.put("Pos", e.getKey() + .serializeNBT()); + e.getValue() + .writeToNBT(innerCompound); + entries.add(innerCompound); + }); + compoundNBT.put("Entries", entries); + return compoundNBT; + })); + } + + public void setProvidedFluid(FluidStack providedFluid) { + this.providedFluid = providedFluid; + } + + class PumpAttachmentBehaviour extends FluidPipeAttachmentBehaviour { + + public PumpAttachmentBehaviour(SmartTileEntity te) { + super(te); + } + + @Override + public boolean isPipeConnectedTowards(BlockState state, Direction direction) { + return isSideAccessible(direction); + } + + @Override + public AttachmentTypes getAttachment(ILightReader world, BlockPos pos, BlockState state, Direction direction) { + AttachmentTypes attachment = super.getAttachment(world, pos, state, direction); + if (attachment == AttachmentTypes.RIM) + return AttachmentTypes.NONE; + return attachment; + } + + } + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/AxisPipeBlock.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/AxisPipeBlock.java new file mode 100644 index 000000000..71a17ee4f --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/AxisPipeBlock.java @@ -0,0 +1,97 @@ +package com.simibubi.create.content.contraptions.fluids.pipes; + +import java.util.Map; +import java.util.Random; + +import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllShapes; +import com.simibubi.create.content.contraptions.fluids.FluidPropagator; +import com.simibubi.create.content.contraptions.wrench.IWrenchable; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.RotatedPillarBlock; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.network.DebugPacketSender; +import net.minecraft.state.BooleanProperty; +import net.minecraft.util.Direction; +import net.minecraft.util.Direction.AxisDirection; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.IWorld; +import net.minecraft.world.TickPriority; +import net.minecraft.world.World; +import net.minecraft.world.server.ServerWorld; + +public class AxisPipeBlock extends RotatedPillarBlock implements IWrenchable { + + public AxisPipeBlock(Properties p_i48339_1_) { + super(p_i48339_1_); + } + + @Override + public void onReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean isMoving) { + boolean blockTypeChanged = state.getBlock() != newState.getBlock(); + if (blockTypeChanged && !world.isRemote) + FluidPropagator.propagateChangedPipe(world, pos, state); + if (state.hasTileEntity() && (blockTypeChanged || !newState.hasTileEntity())) + world.removeTileEntity(pos); + } + + @Override + public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean isMoving) { + if (world.isRemote) + return; + if (state != oldState) + world.getPendingBlockTicks() + .scheduleTick(pos, this, 1, TickPriority.HIGH); + } + + @Override + public ItemStack getPickBlock(BlockState state, RayTraceResult target, IBlockReader world, BlockPos pos, + PlayerEntity player) { + return AllBlocks.FLUID_PIPE.asStack(); + } + + @Override + public void neighborChanged(BlockState state, World world, BlockPos pos, Block otherBlock, BlockPos neighborPos, + boolean isMoving) { + DebugPacketSender.func_218806_a(world, pos); + Direction d = FluidPropagator.validateNeighbourChange(state, world, pos, otherBlock, neighborPos, isMoving); + if (d == null) + return; + if (!isOpenAt(state, d)) + return; + world.getPendingBlockTicks() + .scheduleTick(pos, this, 1, TickPriority.HIGH); + } + + public static boolean isOpenAt(BlockState state, Direction d) { + return d.getAxis() == state.get(AXIS); + } + + @Override + public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random r) { + FluidPropagator.propagateChangedPipe(world, pos, state); + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader p_220053_2_, BlockPos p_220053_3_, + ISelectionContext p_220053_4_) { + return AllShapes.EIGHT_VOXEL_POLE.get(state.get(AXIS)); + } + + public BlockState toRegularPipe(IWorld world, BlockPos pos, BlockState state) { + Direction side = Direction.getFacingFromAxis(AxisDirection.POSITIVE, state.get(AXIS)); + Map facingToPropertyMap = FluidPipeBlock.FACING_TO_PROPERTY_MAP; + return AllBlocks.FLUID_PIPE.get() + .updateBlockState(AllBlocks.FLUID_PIPE.getDefaultState() + .with(facingToPropertyMap.get(side), true) + .with(facingToPropertyMap.get(side.getOpposite()), true), side, null, world, pos); + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/EncasedPipeBlock.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/EncasedPipeBlock.java new file mode 100644 index 000000000..6d236427c --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/EncasedPipeBlock.java @@ -0,0 +1,46 @@ +package com.simibubi.create.content.contraptions.fluids.pipes; + +import com.simibubi.create.AllTileEntities; + +import net.minecraft.block.BlockState; +import net.minecraft.item.ItemUseContext; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResultType; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.World; + +public class EncasedPipeBlock extends AxisPipeBlock { + + public EncasedPipeBlock(Properties p_i48339_1_) { + super(p_i48339_1_); + } + + @Override + public boolean hasTileEntity(BlockState state) { + return true; + } + + @Override + public TileEntity createTileEntity(BlockState state, IBlockReader world) { + return AllTileEntities.ENCASED_FLUID_PIPE.create(); + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader p_220053_2_, BlockPos p_220053_3_, + ISelectionContext p_220053_4_) { + return VoxelShapes.fullCube(); + } + + @Override + public ActionResultType onWrenched(BlockState state, ItemUseContext context) { + World world = context.getWorld(); + BlockPos pos = context.getPos(); + world.setBlockState(pos, toRegularPipe(world, pos, state), 3); + return ActionResultType.SUCCESS; + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/FluidPipeBlock.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/FluidPipeBlock.java new file mode 100644 index 000000000..fdfdbd9fc --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/FluidPipeBlock.java @@ -0,0 +1,248 @@ +package com.simibubi.create.content.contraptions.fluids.pipes; + +import java.util.Random; + +import javax.annotation.Nullable; + +import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllTileEntities; +import com.simibubi.create.content.contraptions.fluids.FluidPipeAttachmentBehaviour; +import com.simibubi.create.content.contraptions.fluids.FluidPropagator; +import com.simibubi.create.content.contraptions.wrench.IWrenchable; +import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; +import com.simibubi.create.foundation.utility.Iterate; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.IWaterLoggable; +import net.minecraft.block.SixWayBlock; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.fluid.Fluids; +import net.minecraft.fluid.IFluidState; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.ItemUseContext; +import net.minecraft.network.DebugPacketSender; +import net.minecraft.state.StateContainer.Builder; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResultType; +import net.minecraft.util.Direction; +import net.minecraft.util.Direction.Axis; +import net.minecraft.util.Direction.AxisDirection; +import net.minecraft.util.Hand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.BlockRayTraceResult; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.ILightReader; +import net.minecraft.world.IWorld; +import net.minecraft.world.TickPriority; +import net.minecraft.world.World; +import net.minecraft.world.server.ServerWorld; + +public class FluidPipeBlock extends SixWayBlock implements IWaterLoggable, IWrenchable { + + public FluidPipeBlock(Properties properties) { + super(4 / 16f, properties); + this.setDefaultState(super.getDefaultState().with(BlockStateProperties.WATERLOGGED, false)); + } + + @Override + public ActionResultType onWrenched(BlockState state, ItemUseContext context) { + World world = context.getWorld(); + BlockPos pos = context.getPos(); + Axis axis = getAxis(world, pos, state); + if (axis == null) + return ActionResultType.PASS; + if (context.getFace() + .getAxis() == axis) + return ActionResultType.PASS; + if (!world.isRemote) + world.setBlockState(pos, AllBlocks.GLASS_FLUID_PIPE.getDefaultState() + .with(GlassFluidPipeBlock.AXIS, axis)); + return ActionResultType.SUCCESS; + } + + @Override + public ActionResultType onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, + BlockRayTraceResult hit) { + if (!AllBlocks.COPPER_CASING.isIn(player.getHeldItem(hand))) + return ActionResultType.PASS; + Axis axis = getAxis(world, pos, state); + if (axis == null) + return ActionResultType.PASS; + if (!world.isRemote) + world.setBlockState(pos, AllBlocks.ENCASED_FLUID_PIPE.getDefaultState() + .with(EncasedPipeBlock.AXIS, axis)); + return ActionResultType.SUCCESS; + } + + @Nullable + private Axis getAxis(IBlockReader world, BlockPos pos, BlockState state) { + if (!FluidPropagator.isStraightPipe(state)) + return null; + Axis axis = null; + for (Direction d : Iterate.directions) { + if (isOpenAt(state, d)) { + axis = d.getAxis(); + break; + } + } + return axis; + } + + @Override + public boolean hasTileEntity(BlockState state) { + return true; + } + + @Override + public TileEntity createTileEntity(BlockState state, IBlockReader world) { + return AllTileEntities.FLUID_PIPE.create(); + } + + @Override + public void onReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean isMoving) { + boolean blockTypeChanged = state.getBlock() != newState.getBlock(); + if (blockTypeChanged && !world.isRemote) + FluidPropagator.propagateChangedPipe(world, pos, state); + if (state.hasTileEntity() && (blockTypeChanged || !newState.hasTileEntity())) + world.removeTileEntity(pos); + } + + @Override + public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean isMoving) { + if (world.isRemote) + return; + if (state != oldState) + world.getPendingBlockTicks() + .scheduleTick(pos, this, 1, TickPriority.HIGH); + } + + @Override + public void neighborChanged(BlockState state, World world, BlockPos pos, Block otherBlock, BlockPos neighborPos, + boolean isMoving) { + DebugPacketSender.func_218806_a(world, pos); + Direction d = FluidPropagator.validateNeighbourChange(state, world, pos, otherBlock, neighborPos, isMoving); + if (d == null) + return; + if (!isOpenAt(state, d)) + return; + world.getPendingBlockTicks() + .scheduleTick(pos, this, 1, TickPriority.HIGH); + } + + @Override + public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random r) { + FluidPropagator.propagateChangedPipe(world, pos, state); + } + + public static boolean isPipe(BlockState state) { + return state.getBlock() instanceof FluidPipeBlock; + } + + public static boolean canConnectTo(ILightReader world, BlockPos pos, BlockState neighbour, Direction blockFace) { + if (isPipe(neighbour) || FluidPropagator.hasFluidCapability(neighbour, world, pos, blockFace)) + return true; + FluidPipeAttachmentBehaviour attachmentBehaviour = + TileEntityBehaviour.get(world, pos, FluidPipeAttachmentBehaviour.TYPE); + if (attachmentBehaviour == null) + return false; + return attachmentBehaviour.isPipeConnectedTowards(neighbour, blockFace.getOpposite()); + } + + public static boolean shouldDrawRim(ILightReader world, BlockPos pos, BlockState state, Direction direction) { + BlockPos offsetPos = pos.offset(direction); + BlockState facingState = world.getBlockState(offsetPos); + if (!isPipe(facingState)) + return true; + if (!isCornerOrEndPipe(world, pos, state)) + return false; + if (FluidPropagator.isStraightPipe(facingState)) + return true; + if (!shouldDrawCasing(world, pos, state) && shouldDrawCasing(world, offsetPos, facingState)) + return true; + if (isCornerOrEndPipe(world, offsetPos, facingState)) + return direction.getAxisDirection() == AxisDirection.POSITIVE; + return true; + } + + public static boolean isOpenAt(BlockState state, Direction direction) { + return state.get(FACING_TO_PROPERTY_MAP.get(direction)); + } + + public static boolean isCornerOrEndPipe(ILightReader world, BlockPos pos, BlockState state) { + return isPipe(state) && !FluidPropagator.isStraightPipe(state) && !shouldDrawCasing(world, pos, state); + } + + public static boolean shouldDrawCasing(ILightReader world, BlockPos pos, BlockState state) { + if (!isPipe(state)) + return false; + for (Axis axis : Iterate.axes) { + int connections = 0; + for (Direction direction : Iterate.directions) + if (direction.getAxis() != axis && isOpenAt(state, direction)) + connections++; + if (connections > 2) + return true; + } + return false; + } + + @Override + protected void fillStateContainer(Builder builder) { + builder.add(NORTH, EAST, SOUTH, WEST, UP, DOWN, BlockStateProperties.WATERLOGGED); + super.fillStateContainer(builder); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + IFluidState ifluidstate = context.getWorld() + .getFluidState(context.getPos()); + return updateBlockState(getDefaultState(), context.getNearestLookingDirection(), null, context.getWorld(), + context.getPos()).with(BlockStateProperties.WATERLOGGED, + Boolean.valueOf(ifluidstate.getFluid() == Fluids.WATER)); + } + + @Override + public BlockState updatePostPlacement(BlockState state, Direction direction, BlockState neighbourState, + IWorld world, BlockPos pos, BlockPos neighbourPos) { + if (state.get(BlockStateProperties.WATERLOGGED)) { + world.getPendingFluidTicks() + .scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + } + return updateBlockState(state, direction, direction.getOpposite(), world, pos); + } + + public BlockState updateBlockState(BlockState state, Direction preferredDirection, @Nullable Direction ignore, + ILightReader world, BlockPos pos) { + // Update sides that are not ignored + for (Direction d : Iterate.directions) + if (d != ignore) + state = state.with(FACING_TO_PROPERTY_MAP.get(d), + canConnectTo(world, pos.offset(d), world.getBlockState(pos.offset(d)), d.getOpposite())); + + // See if it has enough connections + Direction connectedDirection = null; + for (Direction d : Iterate.directions) { + if (isOpenAt(state, d)) { + if (connectedDirection != null) + return state; + connectedDirection = d; + } + } + + // Add opposite end if only one connection + if (connectedDirection != null) + return state.with(FACING_TO_PROPERTY_MAP.get(connectedDirection.getOpposite()), true); + + // Use preferred + return state.with(FACING_TO_PROPERTY_MAP.get(preferredDirection), true) + .with(FACING_TO_PROPERTY_MAP.get(preferredDirection.getOpposite()), true); + } + + @Override + public IFluidState getFluidState(BlockState state) { + return state.get(BlockStateProperties.WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) + : Fluids.EMPTY.getDefaultState(); + } +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/FluidPipeTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/FluidPipeTileEntity.java new file mode 100644 index 000000000..5b0ca5222 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/FluidPipeTileEntity.java @@ -0,0 +1,67 @@ +package com.simibubi.create.content.contraptions.fluids.pipes; + +import java.util.List; + +import com.simibubi.create.content.contraptions.fluids.FluidPipeAttachmentBehaviour; +import com.simibubi.create.content.contraptions.fluids.FluidPipeBehaviour; +import com.simibubi.create.foundation.tileEntity.SmartTileEntity; +import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; + +import net.minecraft.block.BlockState; +import net.minecraft.tileentity.TileEntityType; +import net.minecraft.util.Direction; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.ILightReader; + +public class FluidPipeTileEntity extends SmartTileEntity { + + public FluidPipeTileEntity(TileEntityType tileEntityTypeIn) { + super(tileEntityTypeIn); + } + + @Override + public void addBehaviours(List behaviours) { + behaviours.add(new StandardPipeBehaviour(this)); + behaviours.add(new StandardPipeAttachmentBehaviour(this)); + } + + class StandardPipeBehaviour extends FluidPipeBehaviour { + + public StandardPipeBehaviour(SmartTileEntity te) { + super(te); + } + + @Override + public boolean isConnectedTo(BlockState state, Direction direction) { + return FluidPipeBlock.isPipe(state) && state.get(FluidPipeBlock.FACING_TO_PROPERTY_MAP.get(direction)); + } + + } + + class StandardPipeAttachmentBehaviour extends FluidPipeAttachmentBehaviour { + + public StandardPipeAttachmentBehaviour(SmartTileEntity te) { + super(te); + } + + @Override + public AttachmentTypes getAttachment(ILightReader world, BlockPos pos, BlockState state, Direction direction) { + AttachmentTypes attachment = super.getAttachment(world, pos, state, direction); + + BlockPos offsetPos = pos.offset(direction); + if (!FluidPipeBlock.isPipe(world.getBlockState(offsetPos))) { + FluidPipeAttachmentBehaviour attachmentBehaviour = + TileEntityBehaviour.get(world, offsetPos, FluidPipeAttachmentBehaviour.TYPE); + if (attachmentBehaviour != null && attachmentBehaviour + .isPipeConnectedTowards(world.getBlockState(offsetPos), direction.getOpposite())) + return AttachmentTypes.NONE; + } + + if (attachment == AttachmentTypes.RIM && !FluidPipeBlock.shouldDrawRim(world, pos, state, direction)) + return AttachmentTypes.NONE; + return attachment; + } + + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/GlassFluidPipeBlock.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/GlassFluidPipeBlock.java new file mode 100644 index 000000000..83f3bae69 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/GlassFluidPipeBlock.java @@ -0,0 +1,54 @@ +package com.simibubi.create.content.contraptions.fluids.pipes; + +import com.simibubi.create.AllTileEntities; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.item.ItemUseContext; +import net.minecraft.state.BooleanProperty; +import net.minecraft.state.StateContainer.Builder; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResultType; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.World; + +public class GlassFluidPipeBlock extends AxisPipeBlock { + + public static final BooleanProperty ALT = BooleanProperty.create("alt"); + + public GlassFluidPipeBlock(Properties p_i48339_1_) { + super(p_i48339_1_); + setDefaultState(getDefaultState().with(ALT, false)); + } + + @Override + protected void fillStateContainer(Builder p_206840_1_) { + super.fillStateContainer(p_206840_1_.add(ALT)); + } + + @Override + public boolean hasTileEntity(BlockState state) { + return true; + } + + @Override + public TileEntity createTileEntity(BlockState state, IBlockReader world) { + return AllTileEntities.GLASS_FLUID_PIPE.create(); + } + + @Override + public ActionResultType onWrenched(BlockState state, ItemUseContext context) { + BlockState newState = state; + World world = context.getWorld(); + BlockPos pos = context.getPos(); + if (!state.get(ALT)) + newState = state.with(ALT, true); + else + newState = toRegularPipe(world, pos, state); + world.setBlockState(pos, newState, 3); + return ActionResultType.SUCCESS; + } + + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/StraightPipeTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/StraightPipeTileEntity.java new file mode 100644 index 000000000..b5e273f5b --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/StraightPipeTileEntity.java @@ -0,0 +1,64 @@ +package com.simibubi.create.content.contraptions.fluids.pipes; + +import java.util.List; + +import com.simibubi.create.content.contraptions.fluids.FluidPipeAttachmentBehaviour; +import com.simibubi.create.content.contraptions.fluids.FluidPipeBehaviour; +import com.simibubi.create.foundation.tileEntity.SmartTileEntity; +import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; + +import net.minecraft.block.BlockState; +import net.minecraft.tileentity.TileEntityType; +import net.minecraft.util.Direction; +import net.minecraft.util.Direction.AxisDirection; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.ILightReader; + +public class StraightPipeTileEntity extends SmartTileEntity { + + public StraightPipeTileEntity(TileEntityType tileEntityTypeIn) { + super(tileEntityTypeIn); + } + + @Override + public void addBehaviours(List behaviours) { + behaviours.add(new StraightPipeBehaviour(this)); + behaviours.add(new StraightPipeAttachmentBehaviour(this)); + } + + class StraightPipeBehaviour extends FluidPipeBehaviour { + + public StraightPipeBehaviour(SmartTileEntity te) { + super(te); + } + + @Override + public boolean isConnectedTo(BlockState state, Direction direction) { + return state.get(AxisPipeBlock.AXIS) == direction.getAxis(); + } + + } + + class StraightPipeAttachmentBehaviour extends FluidPipeAttachmentBehaviour { + + public StraightPipeAttachmentBehaviour(SmartTileEntity te) { + super(te); + } + + @Override + public AttachmentTypes getAttachment(ILightReader world, BlockPos pos, BlockState state, Direction direction) { + AttachmentTypes attachment = super.getAttachment(world, pos, state, direction); + BlockState otherState = world.getBlockState(pos.offset(direction)); + if (state.getBlock() instanceof AxisPipeBlock && otherState.getBlock() instanceof AxisPipeBlock) { + if (state.get(AxisPipeBlock.AXIS) == otherState.get(AxisPipeBlock.AXIS)) { + if (state.getBlock() == otherState.getBlock() + || direction.getAxisDirection() == AxisDirection.POSITIVE) + return AttachmentTypes.NONE; + } + } + return attachment; + } + + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/TransparentStraightPipeRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/TransparentStraightPipeRenderer.java new file mode 100644 index 000000000..47f692529 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/pipes/TransparentStraightPipeRenderer.java @@ -0,0 +1,59 @@ +package com.simibubi.create.content.contraptions.fluids.pipes; + +import com.mojang.blaze3d.matrix.MatrixStack; +import com.simibubi.create.content.contraptions.fluids.FluidPipeBehaviour; +import com.simibubi.create.foundation.fluid.FluidRenderer; +import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; +import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer; +import com.simibubi.create.foundation.utility.Iterate; +import com.simibubi.create.foundation.utility.LerpedFloat; +import com.simibubi.create.foundation.utility.Pair; + +import net.minecraft.client.renderer.IRenderTypeBuffer; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.util.Direction; +import net.minecraftforge.fluids.FluidStack; + +public class TransparentStraightPipeRenderer extends SafeTileEntityRenderer { + + public TransparentStraightPipeRenderer(TileEntityRendererDispatcher dispatcher) { + super(dispatcher); + } + + @Override + protected void renderSafe(StraightPipeTileEntity te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffer, + int light, int overlay) { + FluidPipeBehaviour pipe = TileEntityBehaviour.get(te, FluidPipeBehaviour.TYPE); + if (pipe == null) + return; + FluidStack fluidStack = pipe.getFluid(); + if (fluidStack.isEmpty()) + return; + + for (Direction side : Iterate.directions) { + if (!pipe.isConnectedTo(te.getBlockState(), side)) + continue; + Pair strogestFlow = pipe.getStrogestFlow(side); + if (strogestFlow == null) + continue; + LerpedFloat second = strogestFlow.getSecond(); + if (second == null) + continue; + + float value = second.getValue(partialTicks); + Boolean inbound = strogestFlow.getFirst(); + if (value == 1 && !inbound) { + FluidPipeBehaviour adjacent = TileEntityBehaviour.get(te.getWorld(), te.getPos() + .offset(side), FluidPipeBehaviour.TYPE); + + if (adjacent != null && adjacent.getFluid() + .isEmpty()) + value -= 1e-6f; + } + + FluidRenderer.renderFluidStream(fluidStack, side, 3 / 16f, value, inbound, buffer, ms, light); + } + + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidTankBlock.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankBlock.java similarity index 98% rename from src/main/java/com/simibubi/create/content/contraptions/fluids/FluidTankBlock.java rename to src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankBlock.java index c2ec41026..0b209bbbf 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidTankBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankBlock.java @@ -1,4 +1,4 @@ -package com.simibubi.create.content.contraptions.fluids; +package com.simibubi.create.content.contraptions.fluids.tank; import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.wrench.IWrenchable; @@ -182,7 +182,7 @@ public class FluidTankBlock extends Block implements IWrenchable, ITE 0) { + syncCooldown--; + if (syncCooldown == 0 && queuedSync) + sendData(); + } if (updateConnectivity) updateConnectivity(); if (fluidLevel != null) @@ -96,7 +106,7 @@ public class FluidTankTileEntity extends SmartTileEntity { FluidAttributes attributes = newFluidStack.getFluid() .getAttributes(); - int luminosity = attributes.getLuminosity(newFluidStack) / 2; + int luminosity = (int) (attributes.getLuminosity(newFluidStack) / 1.2f); boolean reversed = attributes.isLighterThanAir(); int maxY = (int) ((getFillState() * height) + 1); @@ -116,6 +126,11 @@ public class FluidTankTileEntity extends SmartTileEntity { } } } + + if (!world.isRemote) { + markDirty(); + sendData(); + } } protected void setLuminosity(int luminosity) { @@ -162,6 +177,7 @@ public class FluidTankTileEntity extends SmartTileEntity { getWorld().setBlockState(pos, state, 22); } + refreshCapability(); markDirty(); sendData(); } @@ -173,6 +189,23 @@ public class FluidTankTileEntity extends SmartTileEntity { te.setWindows(!te.window); } + public void sendDataImmediately() { + syncCooldown = 0; + queuedSync = false; + sendData(); + } + + @Override + public void sendData() { + if (syncCooldown > 0) { + queuedSync = true; + return; + } + super.sendData(); + queuedSync = false; + syncCooldown = SYNC_RATE; + } + public void setWindows(boolean window) { this.window = window; for (int yOffset = 0; yOffset < height; yOffset++) { @@ -213,10 +246,18 @@ public class FluidTankTileEntity extends SmartTileEntity { if (controller.equals(this.controller)) return; this.controller = controller; + refreshCapability(); markDirty(); sendData(); } + private void refreshCapability() { + LazyOptional oldCap = fluidCapability; + fluidCapability = LazyOptional.of(() -> isController() ? tankInventory + : getControllerTE() != null ? getControllerTE().tankInventory : new FluidTank(0)); + oldCap.invalidate(); + } + public BlockPos getController() { return isController() ? pos : controller; } @@ -236,39 +277,38 @@ public class FluidTankTileEntity extends SmartTileEntity { } @Override - public void read(CompoundNBT tag) { - super.read(tag); - updateConnectivity = tag.contains("Uninitialized"); - luminosity = tag.getInt("Luminosity"); - controller = null; - - if (tag.contains("Controller")) - controller = NBTUtil.readBlockPos(tag.getCompound("Controller")); - - if (isController()) { - window = tag.getBoolean("Window"); - width = tag.getInt("Size"); - height = tag.getInt("Height"); - tankInventory.setCapacity(getTotalTankSize() * getCapacityMultiplier()); - tankInventory.readFromNBT(tag.getCompound("TankContent")); - if (tankInventory.getSpace() < 0) - tankInventory.drain(-tankInventory.getSpace(), FluidAction.EXECUTE); - } - - if (tag.contains("ForceFluidLevel") || fluidLevel == null) - fluidLevel = new InterpolatedChasingValue().start(getFillState()) - .withSpeed(1 / 2f); - } - - @Override - public void readClientUpdate(CompoundNBT tag) { + protected void read(CompoundNBT compound, boolean clientPacket) { + super.read(compound, clientPacket); + BlockPos controllerBefore = controller; int prevSize = width; int prevHeight = height; int prevLum = luminosity; + + updateConnectivity = compound.contains("Uninitialized"); + luminosity = compound.getInt("Luminosity"); + controller = null; - super.readClientUpdate(tag); + if (compound.contains("Controller")) + controller = NBTUtil.readBlockPos(compound.getCompound("Controller")); + if (isController()) { + window = compound.getBoolean("Window"); + width = compound.getInt("Size"); + height = compound.getInt("Height"); + tankInventory.setCapacity(getTotalTankSize() * getCapacityMultiplier()); + tankInventory.readFromNBT(compound.getCompound("TankContent")); + if (tankInventory.getSpace() < 0) + tankInventory.drain(-tankInventory.getSpace(), FluidAction.EXECUTE); + } + + if (compound.contains("ForceFluidLevel") || fluidLevel == null) + fluidLevel = new InterpolatedChasingValue().start(getFillState()) + .withSpeed(1 / 2f); + + if (!clientPacket) + return; + boolean changeOfController = controllerBefore == null ? controller != null : !controllerBefore.equals(controller); if (changeOfController || prevSize != width || prevHeight != height) { @@ -279,15 +319,17 @@ public class FluidTankTileEntity extends SmartTileEntity { } if (isController()) { float fillState = getFillState(); - if (tag.contains("ForceFluidLevel") || fluidLevel == null) - fluidLevel = new InterpolatedChasingValue().start(fillState) - .withSpeed(1 / 2f); + if (compound.contains("ForceFluidLevel") || fluidLevel == null) + fluidLevel = new InterpolatedChasingValue().start(fillState); fluidLevel.target(fillState); } if (luminosity != prevLum && hasWorld()) world.getChunkProvider() - .getLightManager() - .checkBlock(pos); + .getLightManager() + .checkBlock(pos); + + if (compound.contains("LazySync")) + fluidLevel.withSpeed(compound.contains("LazySync") ? 1 / 8f : 1 / 2f); } protected float getFillState() { @@ -295,44 +337,42 @@ public class FluidTankTileEntity extends SmartTileEntity { } @Override - public CompoundNBT write(CompoundNBT tag) { + public void write(CompoundNBT compound, boolean clientPacket) { if (updateConnectivity) - tag.putBoolean("Uninitialized", true); + compound.putBoolean("Uninitialized", true); if (!isController()) - tag.put("Controller", NBTUtil.writeBlockPos(controller)); + compound.put("Controller", NBTUtil.writeBlockPos(controller)); if (isController()) { - tag.putBoolean("Window", window); - tag.put("TankContent", tankInventory.writeToNBT(new CompoundNBT())); - tag.putInt("Size", width); - tag.putInt("Height", height); + compound.putBoolean("Window", window); + compound.put("TankContent", tankInventory.writeToNBT(new CompoundNBT())); + compound.putInt("Size", width); + compound.putInt("Height", height); } - tag.putInt("Luminosity", luminosity); - return super.write(tag); - } - - @Override - public CompoundNBT writeToClient(CompoundNBT compound) { + compound.putInt("Luminosity", luminosity); + super.write(compound, clientPacket); + + if (!clientPacket) + return; if (forceFluidLevelUpdate) compound.putBoolean("ForceFluidLevel", true); + if (queuedSync) + compound.putBoolean("LazySync", true); forceFluidLevelUpdate = false; - return super.writeToClient(compound); } @Nonnull @Override public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) { - FluidTankTileEntity controller = getControllerTE(); - if (controller != null) - return controller.fluidCapability.cast(); - } + if (!fluidCapability.isPresent()) + refreshCapability(); + if (cap == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) + return fluidCapability.cast(); return super.getCapability(cap, side); } @Override public void remove() { super.remove(); - fluidCapability.invalidate(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinBlock.java b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinBlock.java index bc1c0d703..3b0430bb6 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinBlock.java @@ -83,10 +83,8 @@ public class BasinBlock extends Block implements ITE, IWrenchab withTileEntityDo(worldIn, entityIn.getPosition(), te -> { ItemStack insertItem = ItemHandlerHelper.insertItem(te.inputItemInventory, itemEntity.getItem() .copy(), false); - if (insertItem.isEmpty()) { itemEntity.remove(); - if (!itemEntity.world.isRemote) AllTriggers.triggerForNearbyPlayers(AllTriggers.BASIN_THROW, itemEntity.world, itemEntity.getPosition(), 3); @@ -103,11 +101,15 @@ public class BasinBlock extends Block implements ITE, IWrenchab } @Override - public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) { - if (!state.hasTileEntity() || state.getBlock() == newState.getBlock()) { - return; - } + public VoxelShape getCollisionShape(BlockState p_220071_1_, IBlockReader p_220071_2_, BlockPos p_220071_3_, + ISelectionContext p_220071_4_) { + return AllShapes.BASIN_COLLISION_SHAPE; + } + @Override + public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) { + if (!state.hasTileEntity() || state.getBlock() == newState.getBlock()) + return; withTileEntityDo(worldIn, pos, te -> { ItemHelper.dropContents(worldIn, pos, te.inputItemInventory); ItemHelper.dropContents(worldIn, pos, te.outputItemInventory); diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java index f96fc6384..f7c36dbba 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java @@ -118,8 +118,8 @@ public class BasinTileEntity extends SmartTileEntity implements ITickableTileEnt } @Override - public void read(CompoundNBT compound) { - super.read(compound); + protected void read(CompoundNBT compound, boolean clientPacket) { + super.read(compound, clientPacket); inputItemInventory.deserializeNBT(compound.getCompound("InputItems")); outputItemInventory.deserializeNBT(compound.getCompound("OutputItems")); if (compound.contains("fluids")) @@ -128,15 +128,14 @@ public class BasinTileEntity extends SmartTileEntity implements ITickableTileEnt } @Override - public CompoundNBT write(CompoundNBT compound) { - super.write(compound); + public void write(CompoundNBT compound, boolean clientPacket) { + super.write(compound, clientPacket); compound.put("InputItems", inputItemInventory.serializeNBT()); compound.put("OutputItems", outputItemInventory.serializeNBT()); fluidInventory.ifPresent(combinedFuidHandler -> { ListNBT nbt = combinedFuidHandler.getListNBT(); compound.put("fluids", nbt); }); - return compound; } public void onEmptied() { diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerTileEntity.java index c33559a34..dac3dc308 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerTileEntity.java @@ -155,17 +155,17 @@ public class BlazeBurnerTileEntity extends SmartTileEntity { public void addBehaviours(List behaviours) {} @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.putInt("fuelLevel", activeFuel.ordinal()); compound.putInt("burnTimeRemaining", remainingBurnTime); - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { activeFuel = FuelType.values()[compound.getInt("fuelLevel")]; remainingBurnTime = compound.getInt("burnTimeRemaining"); - super.read(compound); + super.read(compound, clientPacket); } /** diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencedGearshiftTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencedGearshiftTileEntity.java index 717436fd8..b52e47ee2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencedGearshiftTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencedGearshiftTileEntity.java @@ -103,21 +103,21 @@ public class SequencedGearshiftTileEntity extends SplitShaftTileEntity { } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.putInt("InstructionIndex", currentInstruction); compound.putInt("InstructionDuration", currentInstructionDuration); compound.putInt("Timer", timer); compound.put("Instructions", Instruction.serializeAll(instructions)); - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { currentInstruction = compound.getInt("InstructionIndex"); currentInstructionDuration = compound.getInt("InstructionDuration"); timer = compound.getInt("Timer"); instructions = Instruction.deserializeAll(compound.getList("Instructions", NBT.TAG_COMPOUND)); - super.read(compound); + super.read(compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java index 8116171dc..f5adeb459 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java @@ -5,13 +5,11 @@ import java.util.Collections; import java.util.LinkedList; import java.util.List; -import com.simibubi.create.content.contraptions.base.KineticTileEntity; -import org.apache.commons.lang3.mutable.MutableInt; - import com.simibubi.create.AllBlocks; import com.simibubi.create.AllItems; import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.HorizontalKineticBlock; +import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity.CasingType; import com.simibubi.create.content.contraptions.relays.belt.transport.BeltMovementHandler.TransportedEntityInfo; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelBlock; @@ -19,6 +17,7 @@ import com.simibubi.create.content.schematics.ISpecialBlockItemRequirement; import com.simibubi.create.content.schematics.ItemRequirement; import com.simibubi.create.content.schematics.ItemRequirement.ItemUseType; import com.simibubi.create.foundation.block.ITE; +import com.simibubi.create.foundation.utility.BlockHelper; import com.simibubi.create.foundation.utility.Iterate; import net.minecraft.block.Block; @@ -26,7 +25,6 @@ import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.material.Material; -import net.minecraft.client.particle.DiggingParticle; import net.minecraft.client.particle.ParticleManager; import net.minecraft.entity.Entity; import net.minecraft.entity.MobEntity; @@ -52,7 +50,6 @@ import net.minecraft.util.NonNullList; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; -import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; @@ -327,40 +324,7 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE amtBoxes.increment()); - double chance = 1d / amtBoxes.getValue(); - - voxelshape.forEachBox((x1, y1, z1, x2, y2, z2) -> { - double d1 = Math.min(1.0D, x2 - x1); - double d2 = Math.min(1.0D, y2 - y1); - double d3 = Math.min(1.0D, z2 - z1); - int i = Math.max(2, MathHelper.ceil(d1 / 0.25D)); - int j = Math.max(2, MathHelper.ceil(d2 / 0.25D)); - int k = Math.max(2, MathHelper.ceil(d3 / 0.25D)); - - for (int l = 0; l < i; ++l) { - for (int i1 = 0; i1 < j; ++i1) { - for (int j1 = 0; j1 < k; ++j1) { - if (world.rand.nextDouble() > chance) - continue; - - double d4 = ((double) l + 0.5D) / (double) i; - double d5 = ((double) i1 + 0.5D) / (double) j; - double d6 = ((double) j1 + 0.5D) / (double) k; - double d7 = d4 * d1 + x1; - double d8 = d5 * d2 + y1; - double d9 = d6 * d3 + z1; - manager - .addEffect((new DiggingParticle(world, (double) pos.getX() + d7, (double) pos.getY() + d8, - (double) pos.getZ() + d9, d4 - 0.5D, d5 - 0.5D, d6 - 0.5D, state)).setBlockPos(pos)); - } - } - } - - }); + BlockHelper.addReducedDestroyEffects(state, world, pos, manager); return true; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java index dc6ae7376..d19ce518d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java @@ -79,8 +79,7 @@ public class BeltTileEntity extends KineticTileEntity { @Override public void addBehaviours(List behaviours) { super.addBehaviours(behaviours); - behaviours.add(new DirectBeltInputBehaviour(this) - .setInsertionHandler(this::tryInsertingFromSide)); + behaviours.add(new DirectBeltInputBehaviour(this).setInsertionHandler(this::tryInsertingFromSide)); behaviours.add(new TransportedItemStackHandlerBehaviour(this, this::applyToAllItems) .withStackPlacement(this::getWorldPositionOf)); } @@ -175,7 +174,7 @@ public class BeltTileEntity extends KineticTileEntity { } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { if (controller != null) compound.put("Controller", NBTUtil.writeBlockPos(controller)); compound.putBoolean("IsController", isController()); @@ -186,23 +185,12 @@ public class BeltTileEntity extends KineticTileEntity { if (isController()) compound.put("Inventory", getInventory().write()); - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void readClientUpdate(CompoundNBT tag) { - CasingType casingBefore = casing; - super.readClientUpdate(tag); - if (casingBefore != casing) { - requestModelDataUpdate(); - if (hasWorld()) - world.notifyBlockUpdate(getPos(), getBlockState(), getBlockState(), 16); - } - } - - @Override - public void read(CompoundNBT compound) { - super.read(compound); + protected void read(CompoundNBT compound, boolean clientPacket) { + super.read(compound, clientPacket); if (compound.getBoolean("IsController")) controller = pos; @@ -219,7 +207,16 @@ public class BeltTileEntity extends KineticTileEntity { if (isController()) getInventory().read(compound.getCompound("Inventory")); + CasingType casingBefore = casing; casing = NBTHelper.readEnum(compound, "Casing", CasingType.class); + + if (!clientPacket) + return; + if (casingBefore == casing) + return; + requestModelDataUpdate(); + if (hasWorld()) + world.notifyBlockUpdate(getPos(), getBlockState(), getBlockState(), 16); } @Override @@ -397,16 +394,17 @@ public class BeltTileEntity extends KineticTileEntity { BeltTileEntity nextBeltController = getControllerTE(); ItemStack inserted = transportedStack.stack; ItemStack empty = ItemStack.EMPTY; - + if (nextBeltController == null) return inserted; BeltInventory nextInventory = nextBeltController.getInventory(); - + TileEntity teAbove = world.getTileEntity(pos.up()); if (teAbove instanceof BrassTunnelTileEntity) { BrassTunnelTileEntity tunnelTE = (BrassTunnelTileEntity) teAbove; if (tunnelTE.hasDistributionBehaviour()) { - if (!tunnelTE.getStackToDistribute().isEmpty()) + if (!tunnelTE.getStackToDistribute() + .isEmpty()) return inserted; if (!tunnelTE.testFlapFilter(side.getOpposite(), inserted)) return inserted; diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/AbstractEncasedShaftBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/AbstractEncasedShaftBlock.java index cc8273503..3cf1cc57a 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/AbstractEncasedShaftBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/AbstractEncasedShaftBlock.java @@ -1,6 +1,9 @@ package com.simibubi.create.content.contraptions.relays.encased; +import javax.annotation.Nullable; + import com.simibubi.create.content.contraptions.base.RotatedPillarKineticBlock; + import mcp.MethodsReturnNonnullByDefault; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -11,8 +14,6 @@ import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorldReader; -import javax.annotation.Nullable; - @MethodsReturnNonnullByDefault public abstract class AbstractEncasedShaftBlock extends RotatedPillarKineticBlock { public AbstractEncasedShaftBlock(Properties properties) { @@ -30,7 +31,6 @@ public abstract class AbstractEncasedShaftBlock extends RotatedPillarKineticBloc } @Override - @SuppressWarnings("deprecation") public PushReaction getPushReaction(@Nullable BlockState state) { return PushReaction.PUSH_ONLY; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/AdjustablePulleyTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/AdjustablePulleyTileEntity.java index c86f92362..80d831b84 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/AdjustablePulleyTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/AdjustablePulleyTileEntity.java @@ -17,15 +17,15 @@ public class AdjustablePulleyTileEntity extends KineticTileEntity { } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.putInt("Signal", signal); - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { signal = compound.getInt("Signal"); - super.read(compound); + super.read(compound, clientPacket); } public float getModifier() { diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/GearshiftBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/GearshiftBlock.java index 54e7717b7..9e381f491 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/GearshiftBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/GearshiftBlock.java @@ -15,10 +15,8 @@ import net.minecraft.state.BooleanProperty; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; -import net.minecraft.world.IWorldReader; import net.minecraft.world.TickPriority; import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeTileEntity.java index 0e56be79f..3969af754 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeTileEntity.java @@ -21,17 +21,17 @@ public class GaugeTileEntity extends KineticTileEntity implements IHaveGoggleInf } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.putFloat("Value", dialTarget); compound.putInt("Color", color); - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { dialTarget = compound.getFloat("Value"); color = compound.getInt("Color"); - super.read(compound); + super.read(compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandScreen.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandScreen.java index 07115fb43..cba957ade 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandScreen.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandScreen.java @@ -115,7 +115,7 @@ public class SymmetryWandScreen extends AbstractSimiScreen { renderBlock(); GuiGameElement.of(wand) - .at(guiLeft + 220, guiTop + 220) + .at(guiLeft + 200, guiTop + 170) .scale(4) .rotate(-70, 20, 20) .render(); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverTileEntity.java index b423dadfa..969fc6ab2 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverTileEntity.java @@ -73,15 +73,15 @@ public class BeltObserverTileEntity extends SmartTileEntity { } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.putInt("TurnOff", turnOffTicks); - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { turnOffTicks = compound.getInt("TurnOff"); - super.read(compound); + super.read(compound, clientPacket); } } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelTileEntity.java index 123476662..d48faab5c 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelTileEntity.java @@ -52,38 +52,18 @@ public class BeltTunnelTileEntity extends SmartTileEntity { } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { ListNBT flapsNBT = new ListNBT(); for (Direction direction : flaps.keySet()) flapsNBT.add(IntNBT.of(direction.getIndex())); compound.put("Flaps", flapsNBT); - return super.write(compound); - } + super.write(compound, clientPacket); - @Override - public void read(CompoundNBT compound) { - Set newFlaps = new HashSet<>(6); - ListNBT flapsNBT = compound.getList("Flaps", NBT.TAG_INT); - for (INBT inbt : flapsNBT) - if (inbt instanceof IntNBT) - newFlaps.add(Direction.byIndex(((IntNBT) inbt).getInt())); - - for (Direction d : Iterate.directions) - if (!newFlaps.contains(d)) - flaps.remove(d); - else if (!flaps.containsKey(d)) - flaps.put(d, new InterpolatedChasingValue().start(.25f) - .target(0) - .withSpeed(.05f)); + if (!clientPacket) + return; - super.read(compound); - } - - @Override - public CompoundNBT writeToClient(CompoundNBT tag) { - CompoundNBT writeToClient = super.writeToClient(tag); + flapsNBT = new ListNBT(); if (!flapsToSend.isEmpty()) { - ListNBT flapsNBT = new ListNBT(); for (Pair pair : flapsToSend) { CompoundNBT flap = new CompoundNBT(); flap.putInt("Flap", pair.getKey() @@ -91,22 +71,38 @@ public class BeltTunnelTileEntity extends SmartTileEntity { flap.putBoolean("FlapInward", pair.getValue()); flapsNBT.add(flap); } - writeToClient.put("TriggerFlaps", flapsNBT); + compound.put("TriggerFlaps", flapsNBT); flapsToSend.clear(); } - return writeToClient; } @Override - public void readClientUpdate(CompoundNBT tag) { - super.readClientUpdate(tag); - if (tag.contains("TriggerFlaps")) { - ListNBT flapsNBT = tag.getList("TriggerFlaps", NBT.TAG_COMPOUND); - for (INBT inbt : flapsNBT) { - CompoundNBT flap = (CompoundNBT) inbt; - Direction side = Direction.byIndex(flap.getInt("Flap")); - flap(side, flap.getBoolean("FlapInward")); - } + protected void read(CompoundNBT compound, boolean clientPacket) { + Set newFlaps = new HashSet<>(6); + ListNBT flapsNBT = compound.getList("Flaps", NBT.TAG_INT); + for (INBT inbt : flapsNBT) + if (inbt instanceof IntNBT) + newFlaps.add(Direction.byIndex(((IntNBT) inbt).getInt())); + + for (Direction d : Iterate.directions) + if (!newFlaps.contains(d)) + flaps.remove(d); + else if (!flaps.containsKey(d)) + flaps.put(d, new InterpolatedChasingValue().start(.25f) + .target(0) + .withSpeed(.05f)); + + super.read(compound, clientPacket); + + if (!clientPacket) + return; + if (!compound.contains("TriggerFlaps")) + return; + flapsNBT = compound.getList("TriggerFlaps", NBT.TAG_COMPOUND); + for (INBT inbt : flapsNBT) { + CompoundNBT flap = (CompoundNBT) inbt; + Direction side = Direction.byIndex(flap.getInt("Flap")); + flap(side, flap.getBoolean("FlapInward")); } } @@ -131,12 +127,12 @@ public class BeltTunnelTileEntity extends SmartTileEntity { if (!positive && shape == Shape.T_RIGHT) continue; } - + BlockState funnelState = world.getBlockState(getPos().offset(direction)); - if (funnelState.getBlock() instanceof BeltFunnelBlock) + if (funnelState.getBlock() instanceof BeltFunnelBlock) if (funnelState.get(BeltFunnelBlock.HORIZONTAL_FACING) == direction.getOpposite()) continue; - + flaps.put(direction, new InterpolatedChasingValue().start(.25f) .target(0) .withSpeed(.05f)); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java index 97b70ce99..53f6f312d 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java @@ -328,7 +328,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity { } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.putBoolean("ConnectedLeft", connectedLeft); compound.putBoolean("ConnectedRight", connectedRight); @@ -344,14 +344,16 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity { return nbt; })); - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { + boolean wasConnectedLeft = connectedLeft; + boolean wasConnectedRight = connectedRight; + connectedLeft = compound.getBoolean("ConnectedLeft"); connectedRight = compound.getBoolean("ConnectedRight"); - stackToDistribute = ItemStack.read(compound.getCompound("StackToDistribute")); distributionProgress = compound.getFloat("DistributionProgress"); distributionDistanceLeft = compound.getInt("DistanceLeft"); @@ -362,14 +364,10 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity { return Pair.of(pos, face); }); - super.read(compound); - } - - @Override - public void readClientUpdate(CompoundNBT tag) { - boolean wasConnectedLeft = connectedLeft; - boolean wasConnectedRight = connectedRight; - super.readClientUpdate(tag); + super.read(compound, clientPacket); + + if (!clientPacket) + return; if (wasConnectedLeft != connectedLeft || wasConnectedRight != connectedRight) { requestModelDataUpdate(); if (hasWorld()) diff --git a/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteBlock.java index e8a978360..9c6d7e4a6 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteBlock.java @@ -3,17 +3,18 @@ package com.simibubi.create.content.logistics.block.chute; import java.util.HashMap; import java.util.Map; -import com.simibubi.create.AllShapes; import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.wrench.IWrenchable; import com.simibubi.create.foundation.block.ITE; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.belt.DirectBeltInputBehaviour; +import com.simibubi.create.foundation.utility.BlockHelper; import com.simibubi.create.foundation.utility.Iterate; import com.simibubi.create.foundation.utility.Lang; import net.minecraft.block.Block; import net.minecraft.block.BlockState; +import net.minecraft.client.particle.ParticleManager; import net.minecraft.entity.Entity; import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.player.PlayerEntity; @@ -38,13 +39,15 @@ import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorld; import net.minecraft.world.IWorldReader; import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public class ChuteBlock extends Block implements IWrenchable, ITE { public static final IProperty SHAPE = EnumProperty.create("shape", Shape.class); public static final DirectionProperty FACING = BlockStateProperties.FACING_EXCEPT_UP; public enum Shape implements IStringSerializable { - START(), WINDOW_STRAIGHT(), NORMAL(); + INTERSECTION, WINDOW, NORMAL; @Override public String getName() { @@ -170,14 +173,15 @@ public class ChuteBlock extends Block implements IWrenchable, ITE connections = new HashMap<>(); int amtConnections = 0; Direction facing = state.get(FACING); + boolean vertical = facing == Direction.DOWN; - if (facing == Direction.DOWN) - return state; - BlockState target = world.getBlockState(pos.down() - .offset(facing.getOpposite())); - if (!(target.getBlock() instanceof ChuteBlock)) - return state.with(FACING, Direction.DOWN) - .with(SHAPE, Shape.NORMAL); + if (!vertical) { + BlockState target = world.getBlockState(pos.down() + .offset(facing.getOpposite())); + if (!(target.getBlock() instanceof ChuteBlock)) + return state.with(FACING, Direction.DOWN) + .with(SHAPE, Shape.NORMAL); + } for (Direction direction : Iterate.horizontalDirections) { BlockState diagonalInputChute = world.getBlockState(pos.up() @@ -189,31 +193,51 @@ public class ChuteBlock extends Block implements IWrenchable, ITE { BlockState blockState = te.getBlockState(); if (blockState.get(ChuteBlock.FACING) != Direction.DOWN) return; - if (blockState.get(ChuteBlock.SHAPE) != Shape.WINDOW_STRAIGHT) + if (blockState.get(ChuteBlock.SHAPE) != Shape.WINDOW) return; ItemRenderer itemRenderer = Minecraft.getInstance() diff --git a/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteShapes.java b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteShapes.java new file mode 100644 index 000000000..aa8710fbb --- /dev/null +++ b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteShapes.java @@ -0,0 +1,66 @@ +package com.simibubi.create.content.logistics.block.chute; + +import java.util.HashMap; +import java.util.Map; + +import com.simibubi.create.AllShapes; +import com.simibubi.create.content.logistics.block.chute.ChuteBlock.Shape; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.util.Direction; +import net.minecraft.util.math.shapes.IBooleanFunction; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.VoxelShapes; + +public class ChuteShapes { + + static Map cache = new HashMap<>(); + static Map collisionCache = new HashMap<>(); + + public static final VoxelShape INTERSECTION_MASK = Block.makeCuboidShape(0, -16, 0, 16, 16, 16); + public static final VoxelShape COLLISION_MASK = Block.makeCuboidShape(0, 0, 0, 16, 24, 16); + + public static VoxelShape createShape(BlockState state) { + Direction direction = state.get(ChuteBlock.FACING); + Shape shape = state.get(ChuteBlock.SHAPE); + + boolean intersection = shape == Shape.INTERSECTION; + if (direction == Direction.DOWN) + return intersection ? VoxelShapes.fullCube() : AllShapes.CHUTE; + + VoxelShape combineWith = intersection ? VoxelShapes.fullCube() : VoxelShapes.empty(); + VoxelShape result = VoxelShapes.or(combineWith, AllShapes.CHUTE_SLOPE.get(direction)); + if (intersection) + result = VoxelShapes.combine(INTERSECTION_MASK, result, IBooleanFunction.AND); + return result; + } + + public static VoxelShape getShape(BlockState state) { + if (cache.containsKey(state)) + return cache.get(state); + VoxelShape createdShape = createShape(state); + cache.put(state, createdShape); + return createdShape; + } + + public static VoxelShape getCollisionShape(BlockState state) { + if (collisionCache.containsKey(state)) + return collisionCache.get(state); + VoxelShape createdShape = VoxelShapes.combine(COLLISION_MASK, getShape(state), IBooleanFunction.AND); + collisionCache.put(state, createdShape); + return createdShape; + } + + public static final VoxelShape PANEL = Block.makeCuboidShape(1, -15, 0, 15, 4, 1); + + public static VoxelShape createSlope() { + VoxelShape shape = VoxelShapes.empty(); + for (int i = 0; i < 16; i++) { + float offset = i / 16f; + shape = VoxelShapes.combineAndSimplify(shape, PANEL.withOffset(0, offset, offset), IBooleanFunction.OR); + } + return shape; + } + +} diff --git a/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java index 0e65b0f99..776380e50 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java @@ -79,7 +79,7 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor return false; if (getItemMotion() > 0 && getInputChutes().isEmpty()) return false; - return blockState.get(ChuteBlock.FACING) == Direction.DOWN || blockState.get(ChuteBlock.SHAPE) == Shape.START; + return blockState.get(ChuteBlock.FACING) == Direction.DOWN || blockState.get(ChuteBlock.SHAPE) == Shape.INTERSECTION; } @Override @@ -277,22 +277,22 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.put("Item", item.serializeNBT()); compound.putFloat("ItemPosition", itemPosition.value); compound.putFloat("Pull", pull); compound.putFloat("Push", push); - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { ItemStack previousItem = item; item = ItemStack.read(compound.getCompound("Item")); itemPosition.lastValue = itemPosition.value = compound.getFloat("ItemPosition"); pull = compound.getFloat("Pull"); push = compound.getFloat("Push"); - super.read(compound); + super.read(compound, clientPacket); if (hasWorld() && world.isRemote && !previousItem.equals(item, false) && !item.isEmpty()) { if (world.rand.nextInt(3) != 0) diff --git a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotTileEntity.java index c813c00c9..6ee3adc32 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotTileEntity.java @@ -93,20 +93,20 @@ public class DepotTileEntity extends SmartTileEntity { } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { if (heldItem != null) compound.put("HeldItem", heldItem.serializeNBT()); compound.put("OutputBuffer", processingOutputBuffer.serializeNBT()); - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { heldItem = null; if (compound.contains("HeldItem")) heldItem = TransportedItemStack.read(compound.getCompound("HeldItem")); processingOutputBuffer.deserializeNBT(compound.getCompound("OutputBuffer")); - super.read(compound); + super.read(compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterTileEntity.java index 96daf1994..7c4515a1c 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterTileEntity.java @@ -43,17 +43,17 @@ public class AdjustableRepeaterTileEntity extends SmartTileEntity { } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { state = compound.getInt("State"); charging = compound.getBoolean("Charging"); - super.read(compound); + super.read(compound, clientPacket); } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.putInt("State", state); compound.putBoolean("Charging", charging); - return super.write(compound); + super.write(compound, clientPacket); } private int step(StepContext context) { diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java index 007898fe3..d369d0468 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java @@ -218,23 +218,23 @@ public class FunnelTileEntity extends SmartTileEntity { return getBlockState().getBlock() instanceof BeltFunnelBlock && getBlockState().get(BeltFunnelBlock.SHAPE) == Shape.RETRACTED; } - + @Override - public CompoundNBT writeToClient(CompoundNBT compound) { - if (sendFlap != 0) { + protected void write(CompoundNBT compound, boolean clientPacket) { + super.write(compound, clientPacket); + if (clientPacket && sendFlap != 0) { compound.putInt("Flap", sendFlap); sendFlap = 0; } - return super.writeToClient(compound); } - + @Override - public void readClientUpdate(CompoundNBT tag) { - if (tag.contains("Flap")) { - int direction = tag.getInt("Flap"); + protected void read(CompoundNBT compound, boolean clientPacket) { + super.read(compound, clientPacket); + if (clientPacket && compound.contains("Flap")) { + int direction = compound.getInt("Flap"); flap.set(direction); } - super.readClientUpdate(tag); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateTileEntity.java index 18a319954..e2e7a2161 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateTileEntity.java @@ -142,18 +142,18 @@ public class AdjustableCrateTileEntity extends CrateTileEntity implements INamed } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.putBoolean("Main", true); compound.putInt("AllowedAmount", allowedAmount); compound.put("Inventory", inventory.serializeNBT()); - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { allowedAmount = compound.getInt("AllowedAmount"); inventory.deserializeNBT(compound.getCompound("Inventory")); - super.read(compound); + super.read(compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmTileEntity.java index 77be7ffc7..7b477ec19 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmTileEntity.java @@ -272,8 +272,8 @@ public class ArmTileEntity extends KineticTileEntity { } @Override - public CompoundNBT write(CompoundNBT compound) { - super.write(compound); + public void write(CompoundNBT compound, boolean clientPacket) { + super.write(compound, clientPacket); ListNBT pointsNBT = new ListNBT(); inputs.stream() @@ -288,32 +288,24 @@ public class ArmTileEntity extends KineticTileEntity { compound.put("HeldItem", heldItem.serializeNBT()); compound.putInt("TargetPointIndex", chasedPointIndex); compound.putFloat("MovementProgress", chasedPointProgress); - return compound; } @Override - public CompoundNBT writeToClient(CompoundNBT compound) { - super.writeToClient(compound); - return compound; - } - - @Override - public void read(CompoundNBT compound) { - super.read(compound); + protected void read(CompoundNBT compound, boolean clientPacket) { + int previousIndex = chasedPointIndex; + Phase previousPhase = phase; + ListNBT interactionPointTagBefore = interactionPointTag; + + super.read(compound, clientPacket); heldItem = ItemStack.read(compound.getCompound("HeldItem")); phase = NBTHelper.readEnum(compound, "Phase", Phase.class); chasedPointIndex = compound.getInt("TargetPointIndex"); chasedPointProgress = compound.getFloat("MovementProgress"); interactionPointTag = compound.getList("InteractionPoints", NBT.TAG_COMPOUND); - } - - @Override - public void readClientUpdate(CompoundNBT tag) { - int previousIndex = chasedPointIndex; - Phase previousPhase = phase; - ListNBT interactionPointTagBefore = interactionPointTag; - super.readClientUpdate(tag); - + + if (!clientPacket) + return; + boolean ceiling = isOnCeiling(); if (interactionPointTagBefore == null || interactionPointTagBefore.size() != interactionPointTag.size()) updateInteractionPoints = true; diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverTileEntity.java index 2e32a5f5e..99558c5d1 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverTileEntity.java @@ -23,18 +23,18 @@ public class AnalogLeverTileEntity extends SmartTileEntity implements IHaveGoggl } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.putInt("State", state); compound.putInt("ChangeTimer", lastChange); - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { state = compound.getInt("State"); lastChange = compound.getInt("ChangeTimer"); clientState.target(state); - super.read(compound); + super.read(compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkTileEntity.java index 45840b246..65205b6b6 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkTileEntity.java @@ -64,18 +64,18 @@ public class RedstoneLinkTileEntity extends SmartTileEntity { } @Override - public CompoundNBT write(CompoundNBT compound) { + public void write(CompoundNBT compound, boolean clientPacket) { compound.putBoolean("Transmitter", transmitter); compound.putInt("Receive", getReceivedSignal()); compound.putBoolean("ReceivedChanged", receivedSignalChanged); compound.putInt("Transmit", transmittedSignal); - return super.write(compound); + super.write(compound, clientPacket); } @Override - public void read(CompoundNBT compound) { + protected void read(CompoundNBT compound, boolean clientPacket) { transmitter = compound.getBoolean("Transmitter"); - super.read(compound); + super.read(compound, clientPacket); receivedSignal = compound.getInt("Receive"); receivedSignalChanged = compound.getBoolean("ReceivedChanged"); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/StockpileSwitchTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/StockpileSwitchTileEntity.java index 3a1b924a3..af7e59e8d 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/StockpileSwitchTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/StockpileSwitchTileEntity.java @@ -36,25 +36,23 @@ public class StockpileSwitchTileEntity extends SmartTileEntity { } @Override - public void read(CompoundNBT compound) { - + protected void read(CompoundNBT compound, boolean clientPacket) { onWhenAbove = compound.getFloat("OnAbove"); offWhenBelow = compound.getFloat("OffBelow"); currentLevel = compound.getFloat("Current"); powered = compound.getBoolean("Powered"); - super.read(compound); + super.read(compound, clientPacket); } @Override - public CompoundNBT write(CompoundNBT compound) { - + public void write(CompoundNBT compound, boolean clientPacket) { compound.putFloat("OnAbove", onWhenAbove); compound.putFloat("OffBelow", offWhenBelow); compound.putFloat("Current", currentLevel); compound.putBoolean("Powered", powered); - return super.write(compound); + super.write(compound, clientPacket); } public float getLevel() { diff --git a/src/main/java/com/simibubi/create/content/logistics/item/filter/AbstractFilterScreen.java b/src/main/java/com/simibubi/create/content/logistics/item/filter/AbstractFilterScreen.java index bc73d4389..73e532dc4 100644 --- a/src/main/java/com/simibubi/create/content/logistics/item/filter/AbstractFilterScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/item/filter/AbstractFilterScreen.java @@ -6,7 +6,6 @@ import static net.minecraft.util.text.TextFormatting.GRAY; import java.util.Collections; import java.util.List; -import com.mojang.blaze3d.systems.RenderSystem; import com.simibubi.create.content.logistics.item.filter.FilterScreenPacket.Option; import com.simibubi.create.foundation.gui.AbstractSimiContainerScreen; import com.simibubi.create.foundation.gui.AllGuiTextures; @@ -20,7 +19,6 @@ import com.simibubi.create.foundation.item.TooltipHelper; import com.simibubi.create.foundation.networking.AllPackets; import net.minecraft.client.gui.widget.Widget; -import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.text.ITextComponent; diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java index c28ad8bc9..d80dcea62 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java @@ -7,9 +7,9 @@ import com.simibubi.create.AllBlocks; import com.simibubi.create.AllItems; import com.simibubi.create.AllSoundEvents; import com.simibubi.create.content.contraptions.relays.belt.BeltBlock; -import com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity; import com.simibubi.create.content.contraptions.relays.belt.BeltPart; import com.simibubi.create.content.contraptions.relays.belt.BeltSlope; +import com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity; import com.simibubi.create.content.contraptions.relays.elementary.ShaftBlock; import com.simibubi.create.content.schematics.ItemRequirement; import com.simibubi.create.content.schematics.ItemRequirement.ItemUseType; @@ -162,19 +162,13 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC } @Override - public void read(CompoundNBT compound) { - inventory.deserializeNBT(compound.getCompound("Inventory")); - - if (compound.contains("CurrentPos")) - currentPos = NBTUtil.readBlockPos(compound.getCompound("CurrentPos")); - - readClientUpdate(compound); - super.read(compound); - } - - @Override - public void readClientUpdate(CompoundNBT compound) { - + protected void read(CompoundNBT compound, boolean clientPacket) { + if (!clientPacket) { + inventory.deserializeNBT(compound.getCompound("Inventory")); + if (compound.contains("CurrentPos")) + currentPos = NBTUtil.readBlockPos(compound.getCompound("CurrentPos")); + } + // Gui information statusMsg = compound.getString("Status"); schematicProgress = compound.getFloat("Progress"); @@ -184,23 +178,24 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC blocksPlaced = compound.getInt("AmountPlaced"); blocksToPlace = compound.getInt("AmountToPlace"); printingEntityIndex = compound.getInt("EntityProgress"); - + missingItem = null; if (compound.contains("MissingItem")) missingItem = ItemStack.read(compound.getCompound("MissingItem")); - + // Settings CompoundNBT options = compound.getCompound("Options"); replaceMode = options.getInt("ReplaceMode"); skipMissing = options.getBoolean("SkipMissing"); replaceTileEntities = options.getBoolean("ReplaceTileEntities"); - + // Printer & Flying Blocks if (compound.contains("Target")) target = NBTUtil.readBlockPos(compound.getCompound("Target")); if (compound.contains("FlyingBlocks")) readFlyingBlocks(compound); + super.read(compound, clientPacket); } protected void readFlyingBlocks(CompoundNBT compound) { @@ -239,22 +234,16 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC } @Override - public CompoundNBT write(CompoundNBT compound) { - compound.put("Inventory", inventory.serializeNBT()); - - if (state == State.RUNNING) { - compound.putBoolean("Running", true); - if (currentPos != null) - compound.put("CurrentPos", NBTUtil.writeBlockPos(currentPos)); + public void write(CompoundNBT compound, boolean clientPacket) { + if (!clientPacket) { + compound.put("Inventory", inventory.serializeNBT()); + if (state == State.RUNNING) { + compound.putBoolean("Running", true); + if (currentPos != null) + compound.put("CurrentPos", NBTUtil.writeBlockPos(currentPos)); + } } - - writeToClient(compound); - return super.write(compound); - } - - @Override - public CompoundNBT writeToClient(CompoundNBT compound) { - + // Gui information compound.putFloat("Progress", schematicProgress); compound.putFloat("PaperProgress", bookPrintingProgress); @@ -264,17 +253,17 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC compound.putInt("AmountPlaced", blocksPlaced); compound.putInt("AmountToPlace", blocksToPlace); compound.putInt("EntityProgress", printingEntityIndex); - + if (missingItem != null) compound.put("MissingItem", missingItem.serializeNBT()); - + // Settings CompoundNBT options = new CompoundNBT(); options.putInt("ReplaceMode", replaceMode); options.putBoolean("SkipMissing", skipMissing); options.putBoolean("ReplaceTileEntities", replaceTileEntities); compound.put("Options", options); - + // Printer & Flying Blocks if (target != null) compound.put("Target", NBTUtil.writeBlockPos(target)); @@ -283,7 +272,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC tagBlocks.add(b.serializeNBT()); compound.put("FlyingBlocks", tagBlocks); - return compound; + super.write(compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/foundation/advancement/AllAdvancements.java b/src/main/java/com/simibubi/create/foundation/advancement/AllAdvancements.java index 87f2f5c3a..4b1ec3d84 100644 --- a/src/main/java/com/simibubi/create/foundation/advancement/AllAdvancements.java +++ b/src/main/java/com/simibubi/create/foundation/advancement/AllAdvancements.java @@ -308,7 +308,7 @@ public class AllAdvancements implements IDataProvider { @Override public String getName() { - return "CreateAdvancements"; + return "Create's Advancements"; } public PlacedBlockTrigger.Instance placeBlock(Block block) { diff --git a/src/main/java/com/simibubi/create/foundation/config/CFluids.java b/src/main/java/com/simibubi/create/foundation/config/CFluids.java index 580fec6ad..d90eaa7a4 100644 --- a/src/main/java/com/simibubi/create/foundation/config/CFluids.java +++ b/src/main/java/com/simibubi/create/foundation/config/CFluids.java @@ -4,6 +4,7 @@ public class CFluids extends ConfigBase { public ConfigInt fluidTankCapacity = i(8, 1, "fluidTankCapacity", Comments.buckets, Comments.fluidTankCapacity); public ConfigInt fluidTankMaxHeight = i(32, 1, "fluidTankMaxHeight", Comments.blocks, Comments.fluidTankMaxHeight); + public ConfigInt mechanicalPumpRange = i(16, 1, "mechanicalPumpRange", Comments.blocks, Comments.mechanicalPumpRange); @Override public String getName() { @@ -15,6 +16,7 @@ public class CFluids extends ConfigBase { static String buckets = "[in Buckets]"; static String fluidTankCapacity = "The amount of liquid a tank can hold per block."; static String fluidTankMaxHeight = "The maximum height a fluid tank can reach."; + static String mechanicalPumpRange = "The maximum distance a mechanical pump can push or pull liquids on either side."; } } diff --git a/src/main/java/com/simibubi/create/foundation/data/BlockStateGen.java b/src/main/java/com/simibubi/create/foundation/data/BlockStateGen.java index bbf81c149..6cf438249 100644 --- a/src/main/java/com/simibubi/create/foundation/data/BlockStateGen.java +++ b/src/main/java/com/simibubi/create/foundation/data/BlockStateGen.java @@ -19,7 +19,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.cha import com.simibubi.create.content.contraptions.components.structureMovement.mounted.CartAssembleRailType; import com.simibubi.create.content.contraptions.components.structureMovement.mounted.CartAssemblerBlock; import com.simibubi.create.content.contraptions.components.tracks.ReinforcedRailBlock; -import com.simibubi.create.content.contraptions.fluids.FluidPipeBlock; +import com.simibubi.create.content.contraptions.fluids.pipes.FluidPipeBlock; import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock; import com.simibubi.create.content.logistics.block.belts.observer.BeltObserverBlock; import com.simibubi.create.content.palettes.PavedBlock; @@ -58,7 +58,7 @@ public class BlockStateGen { boolean customItem) { return (c, p) -> p.directionalBlock(c.get(), getBlockModel(customItem, c, p)); } - + public static NonNullBiConsumer, RegistrateBlockstateProvider> directionalBlockProviderIgnoresWaterlogged( boolean customItem) { return (c, p) -> directionalBlockIgnoresWaterlogged(c, p, getBlockModel(customItem, c, p)); @@ -212,9 +212,12 @@ public class BlockStateGen { .build(); }); } - - public static NonNullBiConsumer, RegistrateBlockstateProvider> blazeHeater(){ - return (c, p) -> ConfiguredModel.builder().modelFile(p.models().getExistingFile(p.modLoc("block/" + c.getName() + "/block"))).build(); + + public static NonNullBiConsumer, RegistrateBlockstateProvider> blazeHeater() { + return (c, p) -> ConfiguredModel.builder() + .modelFile(p.models() + .getExistingFile(p.modLoc("block/" + c.getName() + "/block"))) + .build(); } public static NonNullBiConsumer, RegistrateBlockstateProvider> reinforcedRail() { diff --git a/src/main/java/com/simibubi/create/foundation/data/StandardRecipes.java b/src/main/java/com/simibubi/create/foundation/data/StandardRecipes.java new file mode 100644 index 000000000..8405fe770 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/data/StandardRecipes.java @@ -0,0 +1,230 @@ +package com.simibubi.create.foundation.data; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; +import java.util.function.UnaryOperator; + +import com.google.common.base.Supplier; +import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllItems; +import com.simibubi.create.Create; +import com.simibubi.create.content.AllSections; +import com.simibubi.create.foundation.utility.Lang; +import com.tterrag.registrate.util.entry.ItemProviderEntry; + +import net.minecraft.block.Blocks; +import net.minecraft.data.DataGenerator; +import net.minecraft.data.IFinishedRecipe; +import net.minecraft.data.RecipeProvider; +import net.minecraft.data.ShapedRecipeBuilder; +import net.minecraft.data.ShapelessRecipeBuilder; +import net.minecraft.item.Items; +import net.minecraft.tags.ItemTags; +import net.minecraft.util.IItemProvider; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.Tags; + +@SuppressWarnings("unused") +public class StandardRecipes extends RecipeProvider { + + final List all = new ArrayList<>(); + + /* + * Recipes are added through fields, so one can navigate to the right one easily + * + * (Ctrl-o) in Eclipse + */ + + private Marker MATERIALS = enterSection(AllSections.MATERIALS); + + GeneratedRecipe ROSE_QUARTZ = create(AllItems.ROSE_QUARTZ).unlockedBy(() -> Items.REDSTONE) + .viaShapeless(b -> b.addIngredient(Tags.Items.GEMS_QUARTZ) + .addIngredient(Tags.Items.DUSTS_REDSTONE) + .addIngredient(Tags.Items.DUSTS_REDSTONE) + .addIngredient(Tags.Items.DUSTS_REDSTONE) + .addIngredient(Tags.Items.DUSTS_REDSTONE) + .addIngredient(Tags.Items.DUSTS_REDSTONE) + .addIngredient(Tags.Items.DUSTS_REDSTONE) + .addIngredient(Tags.Items.DUSTS_REDSTONE) + .addIngredient(Tags.Items.DUSTS_REDSTONE)), + + SAND_PAPER = create(AllItems.SAND_PAPER).unlockedBy(() -> Items.PAPER) + .viaShapeless(b -> b.addIngredient(Items.PAPER) + .addIngredient(Tags.Items.SAND_COLORLESS)), + + RED_SAND_PAPER = create(AllItems.RED_SAND_PAPER).unlockedBy(() -> Items.PAPER) + .viaShapeless(b -> b.addIngredient(Items.PAPER) + .addIngredient(Tags.Items.SAND_RED)) + + // TODO + ; + + private Marker CURIOSITIES = enterSection(AllSections.CURIOSITIES); + // TODO + + private Marker KINETICS = enterSection(AllSections.KINETICS); + // TODO + + private Marker LOGISTICS = enterSection(AllSections.LOGISTICS); + // TODO + + private Marker SCHEMATICS = enterSection(AllSections.SCHEMATICS); + + GeneratedRecipe SCHEMATIC_TABLE = create(AllBlocks.SCHEMATIC_TABLE).unlockedBy(AllItems.EMPTY_SCHEMATIC::get) + .viaShaped(b -> b.key('#', ItemTags.WOODEN_SLABS) + .key('+', Blocks.SMOOTH_STONE) + .patternLine("###") + .patternLine(" + ") + .patternLine(" + ")), + + SCHEMATICANNON = create(AllBlocks.SCHEMATICANNON).unlockedBy(AllItems.EMPTY_SCHEMATIC::get) + .viaShaped(b -> b.key('#', ItemTags.LOGS) + .key('+', Blocks.DISPENSER) + .key('.', Blocks.CAULDRON) + .key('_', Blocks.SMOOTH_STONE) + .key('-', Blocks.IRON_BLOCK) + .patternLine(" . ") + .patternLine("#+#") + .patternLine("_-_")), + + EMPTY_SCHEMATIC = create(AllItems.EMPTY_SCHEMATIC).unlockedBy(() -> Items.PAPER) + .viaShapeless(b -> b.addIngredient(Items.PAPER) + .addIngredient(Tags.Items.DYES_LIGHT_BLUE)), + + SCHEMATIC_AND_QUILL = create(AllItems.SCHEMATIC_AND_QUILL).unlockedBy(() -> Items.PAPER) + .viaShapeless(b -> b.addIngredient(AllItems.EMPTY_SCHEMATIC.get()) + .addIngredient(Tags.Items.FEATHERS)) + + ; + private Marker APPLIANCES = enterFolder("appliances"); + + GeneratedRecipe + + DOUGH = create(AllItems.DOUGH).unlockedBy(AllItems.WHEAT_FLOUR::get) + .viaShapeless(b -> b.addIngredient(AllItems.WHEAT_FLOUR.get()) + .addIngredient(Items.WATER_BUCKET)), + + SLIME_BALL = create(() -> Items.SLIME_BALL).unlockedBy(AllItems.DOUGH::get) + .viaShapeless(b -> b.addIngredient(AllItems.DOUGH.get()) + .addIngredient(Tags.Items.DYES_LIME)), + + CAKE = create(() -> Items.CAKE).unlockedBy(AllItems.DOUGH::get) + .viaShaped(b -> b.key('#', Items.SUGAR) + .key('+', Tags.Items.EGGS) + .key('.', Items.MILK_BUCKET) + .key('-', AllItems.DOUGH.get()) + .patternLine(" . ") + .patternLine("#+#") + .patternLine(" - ")) + + ; + /* + * End of recipe list + */ + + String currentFolder = ""; + + Marker enterSection(AllSections section) { + currentFolder = Lang.asId(section.name()); + return new Marker(); + } + + Marker enterFolder(String folder) { + currentFolder = folder; + return new Marker(); + } + + GeneratedRecipeBuilder create(ItemProviderEntry result) { + return create(result::get); + } + + GeneratedRecipeBuilder create(Supplier result) { + return new GeneratedRecipeBuilder(currentFolder, result); + } + + @FunctionalInterface + interface GeneratedRecipe { + void register(Consumer consumer); + } + + class Marker { + } + + class GeneratedRecipeBuilder { + + private String path; + private String suffix; + private Supplier result; + private Supplier unlockedBy; + private int amount; + + public GeneratedRecipeBuilder(String path, Supplier result) { + this.path = path; + this.suffix = ""; + this.result = result; + this.amount = 1; + } + + GeneratedRecipeBuilder returns(int amount) { + this.amount = amount; + return this; + } + + GeneratedRecipeBuilder unlockedBy(Supplier item) { + this.unlockedBy = item; + return this; + } + + GeneratedRecipeBuilder withSuffix(String suffix) { + this.suffix = suffix; + return this; + } + + GeneratedRecipe viaShaped(UnaryOperator builder) { + return register(consumer -> { + ShapedRecipeBuilder b = builder.apply(ShapedRecipeBuilder.shapedRecipe(result.get(), amount)); + if (unlockedBy != null) + b.addCriterion("has_item", hasItem(unlockedBy.get())); + b.build(consumer, createLocation("crafting_shaped")); + }); + } + + GeneratedRecipe viaShapeless(UnaryOperator builder) { + return register(consumer -> { + ShapelessRecipeBuilder b = builder.apply(ShapelessRecipeBuilder.shapelessRecipe(result.get(), amount)); + if (unlockedBy != null) + b.addCriterion("has_item", hasItem(unlockedBy.get())); + b.build(consumer, createLocation("crafting_shapeless")); + }); + } + + private GeneratedRecipe register(GeneratedRecipe recipe) { + all.add(recipe); + return recipe; + } + + private ResourceLocation createLocation(String recipeType) { + return Create.asResource(recipeType + "/" + path + "/" + result.get() + .asItem() + .getRegistryName() + .getPath() + suffix); + } + + } + + @Override + public String getName() { + return "Create's Standard Recipes"; + } + + public StandardRecipes(DataGenerator p_i48262_1_) { + super(p_i48262_1_); + } + + @Override + protected void registerRecipes(Consumer p_200404_1_) { + all.forEach(c -> c.register(p_200404_1_)); + } + +} diff --git a/src/main/java/com/simibubi/create/foundation/fluid/FluidHelper.java b/src/main/java/com/simibubi/create/foundation/fluid/FluidHelper.java index ad9fb00a6..edbf986bb 100644 --- a/src/main/java/com/simibubi/create/foundation/fluid/FluidHelper.java +++ b/src/main/java/com/simibubi/create/foundation/fluid/FluidHelper.java @@ -2,7 +2,10 @@ package com.simibubi.create.foundation.fluid; import javax.annotation.Nullable; +import net.minecraft.fluid.Fluid; +import net.minecraft.fluid.Fluids; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.ForgeFlowingFluid; import net.minecraftforge.fluids.capability.IFluidHandler; import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction; import net.minecraftforge.fluids.capability.IFluidHandlerItem; @@ -13,6 +16,34 @@ public class FluidHelper { ITEM_TO_TANK, TANK_TO_ITEM; } + public static boolean isWater(Fluid fluid) { + return convertToStill(fluid) == Fluids.WATER; + } + + public static boolean isLava(Fluid fluid) { + return convertToStill(fluid) == Fluids.LAVA; + } + + public static Fluid convertToFlowing(Fluid fluid) { + if (fluid == Fluids.WATER) + return Fluids.FLOWING_WATER; + if (fluid == Fluids.LAVA) + return Fluids.FLOWING_LAVA; + if (fluid instanceof ForgeFlowingFluid) + return ((ForgeFlowingFluid) fluid).getFlowingFluid(); + return fluid; + } + + public static Fluid convertToStill(Fluid fluid) { + if (fluid == Fluids.FLOWING_WATER) + return Fluids.WATER; + if (fluid == Fluids.FLOWING_LAVA) + return Fluids.LAVA; + if (fluid instanceof ForgeFlowingFluid) + return ((ForgeFlowingFluid) fluid).getStillFluid(); + return fluid; + } + @Nullable public static FluidExchange exchange(IFluidHandler fluidTank, IFluidHandlerItem fluidItem, FluidExchange preferred, int maxAmount) { diff --git a/src/main/java/com/simibubi/create/foundation/fluid/FluidRenderer.java b/src/main/java/com/simibubi/create/foundation/fluid/FluidRenderer.java index 4e5e7c41e..b6bf69a7b 100644 --- a/src/main/java/com/simibubi/create/foundation/fluid/FluidRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/fluid/FluidRenderer.java @@ -1,8 +1,12 @@ package com.simibubi.create.foundation.fluid; +import java.util.function.Function; + import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.matrix.MatrixStack.Entry; import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.simibubi.create.foundation.utility.AngleHelper; +import com.simibubi.create.foundation.utility.ColorHelper; import com.simibubi.create.foundation.utility.Iterate; import com.simibubi.create.foundation.utility.MatrixStacker; @@ -15,6 +19,8 @@ import net.minecraft.inventory.container.PlayerContainer; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3i; import net.minecraftforge.fluids.FluidAttributes; @@ -22,6 +28,55 @@ import net.minecraftforge.fluids.FluidStack; public class FluidRenderer { + public static void renderFluidStream(FluidStack fluidStack, Direction direction, float radius, float progress, + boolean inbound, IRenderTypeBuffer buffer, MatrixStack ms, int light) { + Fluid fluid = fluidStack.getFluid(); + FluidAttributes fluidAttributes = fluid.getAttributes(); + Function spriteAtlas = Minecraft.getInstance() + .getSpriteAtlas(PlayerContainer.BLOCK_ATLAS_TEXTURE); + TextureAtlasSprite flowTexture = spriteAtlas.apply(fluidAttributes.getFlowingTexture(fluidStack)); + TextureAtlasSprite stillTexture = spriteAtlas.apply(fluidAttributes.getStillTexture(fluidStack)); + + int color = fluidAttributes.getColor(fluidStack); + IVertexBuilder builder = buffer.getBuffer(RenderType.getTranslucent()); + MatrixStacker msr = MatrixStacker.of(ms); + int blockLightIn = (light >> 4) & 0xf; + int luminosity = Math.max(blockLightIn, fluidAttributes.getLuminosity(fluidStack)); + light = (light & 0xf00000) | luminosity << 4; + + if (inbound) + direction = direction.getOpposite(); + + ms.push(); + msr.centre() + .rotateY(AngleHelper.horizontalAngle(direction)) + .rotateX(direction == Direction.UP ? 0 : direction == Direction.DOWN ? 180 : 90) + .unCentre(); + ms.translate(.5, 0, .5); + + float h = (float) (radius); + float hMin = (float) (-radius); + float hMax = (float) (radius); + float y = inbound ? 0 : .5f; + float yMin = y; + float yMax = y + MathHelper.clamp(progress * .5f - 1e-6f, 0, 1); + + for (int i = 0; i < 4; i++) { + ms.push(); + renderTiledHorizontalFace(h, Direction.SOUTH, hMin, yMin, hMax, yMax, builder, ms, light, color, + flowTexture); + ms.pop(); + msr.rotateY(90); + } + + if (progress != 1) + renderTiledVerticalFace(yMax, Direction.UP, hMin, hMin, hMax, hMax, builder, ms, light, color, + stillTexture); + + ms.pop(); + + } + public static void renderTiledFluidBB(FluidStack fluidStack, float xMin, float yMin, float zMin, float xMax, float yMax, float zMax, IRenderTypeBuffer buffer, MatrixStack ms, int light, boolean renderBottom) { Fluid fluid = fluidStack.getFluid(); @@ -62,8 +117,9 @@ public class FluidRenderer { .translateBack(center); boolean X = side.getAxis() == Axis.X; + int darkColor = ColorHelper.mixColors(color, 0xff000011, 1 / 4f); renderTiledHorizontalFace(X ? xMax : zMax, side, X ? zMin : xMin, yMin, X ? zMax : xMax, yMax, builder, - ms, light, color, fluidTexture); + ms, light, darkColor, fluidTexture); ms.pop(); continue; @@ -111,10 +167,11 @@ public class FluidRenderer { for (float y1 = yMin; y1 < yMax; y1 = y2) { y2 = Math.min((int) (y1 + 1), yMax); - float u1 = texture.getInterpolatedU(local(h1) * 16); - float v1 = texture.getInterpolatedV(local(y1) * 16); - float u2 = texture.getInterpolatedU(h2 == hMax ? local(h2) * 16 : 16); - float v2 = texture.getInterpolatedV(y2 == yMax ? local(y2) * 16 : 16); + int multiplier = texture.getWidth() == 32 ? 8 : 16; + float u1 = texture.getInterpolatedU(local(h1) * multiplier); + float v1 = texture.getInterpolatedV(local(y1) * multiplier); + float u2 = texture.getInterpolatedU(h2 == hMax ? local(h2) * multiplier : multiplier); + float v2 = texture.getInterpolatedV(y2 == yMax ? local(y2) * multiplier : multiplier); float x1 = X ? h : h1; float x2 = X ? h : h2; diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/PosBoundSmartTileEntity.java b/src/main/java/com/simibubi/create/foundation/tileEntity/PosBoundSmartTileEntity.java deleted file mode 100644 index 2a3da1db6..000000000 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/PosBoundSmartTileEntity.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.simibubi.create.foundation.tileEntity; - -import net.minecraft.nbt.CompoundNBT; -import net.minecraft.tileentity.TileEntityType; -import net.minecraft.util.math.BlockPos; - -public abstract class PosBoundSmartTileEntity extends SmartTileEntity { - - private boolean newPositionVisited; - - public PosBoundSmartTileEntity(TileEntityType tileEntityTypeIn) { - super(tileEntityTypeIn); - newPositionVisited = true; - } - - @Override - public void initialize() { - if (!world.isRemote && newPositionVisited) { - newPositionVisited = false; - initInNewPosition(); - } - super.initialize(); - } - - @Override - public void read(CompoundNBT compound) { - long positionInTag = new BlockPos(compound.getInt("x"), compound.getInt("y"), compound.getInt("z")).toLong(); - long positionKey = compound.getLong("BoundPosition"); - - newPositionVisited = false; - if (!hasWorld() || !world.isRemote) { - if (positionInTag != positionKey) { - removePositionDependentData(compound); - newPositionVisited = true; - } - } - - super.read(compound); - } - - /** - * Server-only. When this TE realizes, that it's reading its tag in a different - * position, it should remove all position dependent information here. - * - * @param nbt - */ - protected void removePositionDependentData(CompoundNBT nbt) { - - } - - /** - * Server-only. When a TE has been created or moved, it will call this before the - * regular init. - */ - protected void initInNewPosition() { - - } - -} diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/SmartTileEntity.java b/src/main/java/com/simibubi/create/foundation/tileEntity/SmartTileEntity.java index eeb6663ce..25c74b7d7 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/SmartTileEntity.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/SmartTileEntity.java @@ -38,8 +38,7 @@ public abstract class SmartTileEntity extends SyncedTileEntity implements ITicka * Gets called just before reading tile data for behaviours. Register anything * here that depends on your custom te data. */ - public void addBehavioursDeferred(List behaviours) { - } + public void addBehavioursDeferred(List behaviours) {} @Override public void tick() { @@ -53,44 +52,61 @@ public abstract class SmartTileEntity extends SyncedTileEntity implements ITicka lazyTick(); } - behaviours.values().forEach(TileEntityBehaviour::tick); + behaviours.values() + .forEach(TileEntityBehaviour::tick); } public void initialize() { - behaviours.values().forEach(TileEntityBehaviour::initialize); + behaviours.values() + .forEach(TileEntityBehaviour::initialize); lazyTick(); } - public void updateClient(CompoundNBT compound) { - behaviours.values().forEach(tb -> tb.updateClient(compound)); + @Override + public final CompoundNBT write(CompoundNBT compound) { + write(compound, false); + return compound; } @Override - public CompoundNBT write(CompoundNBT compound) { - behaviours.values().forEach(tb -> tb.writeNBT(compound)); - return super.write(compound); + public final CompoundNBT writeToClient(CompoundNBT compound) { + write(compound, true); + return compound; + } + + @Override + public final void readClientUpdate(CompoundNBT tag) { + read(tag, true); } @Override - public CompoundNBT writeToClient(CompoundNBT compound) { - behaviours.values().forEach(tb -> tb.writeToClient(compound)); - return super.writeToClient(compound); + public final void read(CompoundNBT tag) { + read(tag, false); } - @Override - public void read(CompoundNBT compound) { + /** + * Hook only these in future subclasses of STE + */ + protected void read(CompoundNBT compound, boolean clientPacket) { if (firstNbtRead) { firstNbtRead = false; ArrayList list = new ArrayList<>(); addBehavioursDeferred(list); list.forEach(b -> behaviours.put(b.getType(), b)); } - super.read(compound); - forEachBehaviour(tb -> tb.readNBT(compound)); - - if (world != null && world.isRemote) - updateClient(compound); + behaviours.values() + .forEach(tb -> tb.read(compound, clientPacket)); + } + + + /** + * Hook only these in future subclasses of STE + */ + protected void write(CompoundNBT compound, boolean clientPacket) { + super.write(compound); + behaviours.values() + .forEach(tb -> tb.write(compound, clientPacket)); } @Override @@ -107,12 +123,13 @@ public abstract class SmartTileEntity extends SyncedTileEntity implements ITicka public void lazyTick() { } - + protected void forEachBehaviour(Consumer action) { - behaviours.values().forEach(tb -> { - if (!tb.isPaused()) - action.accept(tb); - }); + behaviours.values() + .forEach(tb -> { + if (!tb.isPaused()) + action.accept(tb); + }); } protected void putBehaviour(TileEntityBehaviour behaviour) { diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/TileEntityBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/TileEntityBehaviour.java index c6aa76d99..dd89490aa 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/TileEntityBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/TileEntityBehaviour.java @@ -37,15 +37,11 @@ public abstract class TileEntityBehaviour { } - public void readNBT(CompoundNBT nbt) { + public void read(CompoundNBT nbt, boolean clientPacket) { } - - public void updateClient(CompoundNBT nbt) { - - } - - public void writeNBT(CompoundNBT nbt) { + + public void write(CompoundNBT nbt, boolean clientPacket) { } @@ -111,8 +107,4 @@ public abstract class TileEntityBehaviour { return ste.getBehaviour(type); } - public CompoundNBT writeToClient(CompoundNBT compound) { - return compound; - } - } diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java index 9dbffb81a..79148ad8a 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java @@ -52,30 +52,26 @@ public class FilteringBehaviour extends TileEntityBehaviour { } @Override - public void writeNBT(CompoundNBT nbt) { + public void write(CompoundNBT nbt, boolean clientPacket) { nbt.put("Filter", getFilter().serializeNBT()); nbt.putInt("FilterAmount", count); - super.writeNBT(nbt); + + if (clientPacket && forceClientState) { + nbt.putBoolean("ForceScrollable", true); + forceClientState = false; + } + super.write(nbt, clientPacket); } @Override - public void readNBT(CompoundNBT nbt) { + public void read(CompoundNBT nbt, boolean clientPacket) { filter = ItemStack.read(nbt.getCompound("Filter")); count = nbt.getInt("FilterAmount"); if (nbt.contains("ForceScrollable")) { scrollableValue = count; ticksUntilScrollPacket = -1; } - super.readNBT(nbt); - } - - @Override - public CompoundNBT writeToClient(CompoundNBT compound) { - if (forceClientState) { - compound.putBoolean("ForceScrollable", true); - forceClientState = false; - } - return super.writeToClient(compound); + super.read(nbt, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/SidedFilteringBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/SidedFilteringBehaviour.java index 7dc6bf4e3..93127fd13 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/SidedFilteringBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/SidedFilteringBehaviour.java @@ -35,12 +35,12 @@ public class SidedFilteringBehaviour extends FilteringBehaviour { sidedFilters = new IdentityHashMap<>(); updateFilterPresence(); } - + @Override public void initialize() { super.initialize(); } - + public FilteringBehaviour get(Direction side) { return sidedFilters.get(side); } @@ -59,40 +59,27 @@ public class SidedFilteringBehaviour extends FilteringBehaviour { } @Override - public void writeNBT(CompoundNBT nbt) { + public void write(CompoundNBT nbt, boolean clientPacket) { nbt.put("Filters", NBTHelper.writeCompoundList(sidedFilters.entrySet(), entry -> { CompoundNBT compound = new CompoundNBT(); compound.putInt("Side", entry.getKey() .getIndex()); entry.getValue() - .writeNBT(compound); + .write(compound, clientPacket); return compound; })); - super.writeNBT(nbt); + super.write(nbt, clientPacket); } @Override - public void readNBT(CompoundNBT nbt) { + public void read(CompoundNBT nbt, boolean clientPacket) { NBTHelper.iterateCompoundList(nbt.getList("Filters", NBT.TAG_COMPOUND), compound -> { Direction face = Direction.byIndex(compound.getInt("Side")); if (sidedFilters.containsKey(face)) sidedFilters.get(face) - .readNBT(compound); + .read(compound, clientPacket); }); - super.readNBT(nbt); - } - - @Override - public CompoundNBT writeToClient(CompoundNBT nbt) { - nbt.put("Filters", NBTHelper.writeCompoundList(sidedFilters.entrySet(), entry -> { - CompoundNBT compound = new CompoundNBT(); - compound.putInt("Side", entry.getKey() - .getIndex()); - entry.getValue() - .writeToClient(compound); - return compound; - })); - return super.writeToClient(nbt); + super.read(nbt, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/inventory/SingleTargetAutoExtractingBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/inventory/SingleTargetAutoExtractingBehaviour.java index 763b83034..3c2f26797 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/inventory/SingleTargetAutoExtractingBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/inventory/SingleTargetAutoExtractingBehaviour.java @@ -33,15 +33,15 @@ public class SingleTargetAutoExtractingBehaviour extends AutoExtractingBehaviour } @Override - public void writeNBT(CompoundNBT nbt) { + public void write(CompoundNBT nbt, boolean clientPacket) { nbt.putBoolean("Advantage", advantageOnNextSync); - super.writeNBT(nbt); + super.write(nbt, clientPacket); } @Override - public void readNBT(CompoundNBT nbt) { + public void read(CompoundNBT nbt, boolean clientPacket) { advantageOnNextSync = nbt.getBoolean("Advantage"); - super.readNBT(nbt); + super.read(nbt, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/linked/LinkBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/linked/LinkBehaviour.java index 6d96d6a9b..651fd7828 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/linked/LinkBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/linked/LinkBehaviour.java @@ -116,26 +116,26 @@ public class LinkBehaviour extends TileEntityBehaviour { } @Override - public void writeNBT(CompoundNBT compound) { - super.writeNBT(compound); - compound.put("FrequencyFirst", frequencyFirst.getStack() + public void write(CompoundNBT nbt, boolean clientPacket) { + super.write(nbt, clientPacket); + nbt.put("FrequencyFirst", frequencyFirst.getStack() .write(new CompoundNBT())); - compound.put("FrequencyLast", frequencyLast.getStack() + nbt.put("FrequencyLast", frequencyLast.getStack() .write(new CompoundNBT())); - compound.putLong("LastKnownPosition", tileEntity.getPos() + nbt.putLong("LastKnownPosition", tileEntity.getPos() .toLong()); } @Override - public void readNBT(CompoundNBT compound) { + public void read(CompoundNBT nbt, boolean clientPacket) { long positionInTag = tileEntity.getPos() .toLong(); - long positionKey = compound.getLong("LastKnownPosition"); + long positionKey = nbt.getLong("LastKnownPosition"); newPosition = positionInTag != positionKey; - super.readNBT(compound); - frequencyFirst = new Frequency(ItemStack.read(compound.getCompound("FrequencyFirst"))); - frequencyLast = new Frequency(ItemStack.read(compound.getCompound("FrequencyLast"))); + super.read(nbt, clientPacket); + frequencyFirst = new Frequency(ItemStack.read(nbt.getCompound("FrequencyFirst"))); + frequencyLast = new Frequency(ItemStack.read(nbt.getCompound("FrequencyLast"))); } public void setFrequency(boolean first, ItemStack stack) { diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/scrollvalue/ScrollValueBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/scrollvalue/ScrollValueBehaviour.java index a9585d883..9f0f3c089 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/scrollvalue/ScrollValueBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/scrollvalue/ScrollValueBehaviour.java @@ -51,28 +51,23 @@ public class ScrollValueBehaviour extends TileEntityBehaviour { } @Override - public void writeNBT(CompoundNBT nbt) { + public void write(CompoundNBT nbt, boolean clientPacket) { nbt.putInt("ScrollValue", value); - super.writeNBT(nbt); + if (clientPacket && forceClientState) { + nbt.putBoolean("ForceScrollable", true); + forceClientState = false; + } + super.write(nbt, clientPacket); } @Override - public void readNBT(CompoundNBT nbt) { + public void read(CompoundNBT nbt, boolean clientPacket) { value = nbt.getInt("ScrollValue"); if (nbt.contains("ForceScrollable")) { ticksUntilScrollPacket = -1; scrollableValue = value; } - super.readNBT(nbt); - } - - @Override - public CompoundNBT writeToClient(CompoundNBT compound) { - if (forceClientState) { - compound.putBoolean("ForceScrollable", true); - forceClientState = false; - } - return super.writeToClient(compound); + super.read(nbt, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/simple/DeferralBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/simple/DeferralBehaviour.java index b9a195aa7..59db72bcf 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/simple/DeferralBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/simple/DeferralBehaviour.java @@ -21,15 +21,15 @@ public class DeferralBehaviour extends TileEntityBehaviour { } @Override - public void writeNBT(CompoundNBT nbt) { + public void write(CompoundNBT nbt, boolean clientPacket) { nbt.putBoolean("NeedsUpdate", needsUpdate); - super.writeNBT(nbt); + super.write(nbt, clientPacket); } @Override - public void readNBT(CompoundNBT nbt) { + public void read(CompoundNBT nbt, boolean clientPacket) { needsUpdate = nbt.getBoolean("NeedsUpdate"); - super.readNBT(nbt); + super.read(nbt, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/foundation/utility/AngleHelper.java b/src/main/java/com/simibubi/create/foundation/utility/AngleHelper.java index f42a9f6c0..9884e71c4 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/AngleHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/AngleHelper.java @@ -1,20 +1,9 @@ package com.simibubi.create.foundation.utility; -import com.mojang.blaze3d.matrix.MatrixStack; - -import net.minecraft.client.renderer.Vector3f; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; public class AngleHelper { - - @OnlyIn(Dist.CLIENT) - public static void applyRotation(Direction direction, MatrixStack ms) { - ms.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(AngleHelper.horizontalAngle(direction))); - ms.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(AngleHelper.verticalAngle(direction))); - } public static float horizontalAngle(Direction facing) { float angle = facing.getHorizontalAngle(); @@ -39,8 +28,8 @@ public class AngleHelper { return (float) (angle * 180 / Math.PI); } - public static float angleLerp(float pct, float current, float target) { - return current + getShortestAngleDiff(current, target) * pct; + public static float angleLerp(double pct, double current, double target) { + return (float) (current + getShortestAngleDiff(current, target) * pct); } public static float getShortestAngleDiff(double current, double target) { diff --git a/src/main/java/com/simibubi/create/foundation/utility/BlockFace.java b/src/main/java/com/simibubi/create/foundation/utility/BlockFace.java new file mode 100644 index 000000000..272c6adc8 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/utility/BlockFace.java @@ -0,0 +1,52 @@ +package com.simibubi.create.foundation.utility; + +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.util.Direction; +import net.minecraft.util.math.BlockPos; + +public class BlockFace extends Pair { + + public BlockFace(BlockPos first, Direction second) { + super(first, second); + } + + public boolean isEquivalent(BlockFace other) { + if (equals(other)) + return true; + return getConnectedPos().equals(other.getPos()) && getPos().equals(other.getConnectedPos()); + } + + public BlockPos getPos() { + return getFirst(); + } + + public Direction getFace() { + return getSecond(); + } + + public Direction getOppositeFace() { + return getSecond().getOpposite(); + } + + public BlockFace getOpposite() { + return new BlockFace(getConnectedPos(), getOppositeFace()); + } + + public BlockPos getConnectedPos() { + return getPos().offset(getFace()); + } + + public CompoundNBT serializeNBT() { + CompoundNBT compoundNBT = new CompoundNBT(); + compoundNBT.put("Pos", NBTUtil.writeBlockPos(getPos())); + NBTHelper.writeEnum(compoundNBT, "Face", getFace()); + return compoundNBT; + } + + public static BlockFace fromNBT(CompoundNBT compound) { + return new BlockFace(NBTUtil.readBlockPos(compound.getCompound("Pos")), + NBTHelper.readEnum(compound, "Face", Direction.class)); + } + +} diff --git a/src/main/java/com/simibubi/create/foundation/utility/BlockHelper.java b/src/main/java/com/simibubi/create/foundation/utility/BlockHelper.java index 1197aa3cf..6b2933e16 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/BlockHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/BlockHelper.java @@ -2,8 +2,12 @@ package com.simibubi.create.foundation.utility; import java.util.function.Consumer; +import org.apache.commons.lang3.mutable.MutableInt; + import net.minecraft.block.Block; import net.minecraft.block.BlockState; +import net.minecraft.client.particle.DiggingParticle; +import net.minecraft.client.particle.ParticleManager; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.fluid.IFluidState; import net.minecraft.item.Item; @@ -12,18 +16,59 @@ import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.SlabType; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.GameRules; import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public class BlockHelper { + @OnlyIn(Dist.CLIENT) + public static void addReducedDestroyEffects(BlockState state, World world, BlockPos pos, ParticleManager manager) { + VoxelShape voxelshape = state.getShape(world, pos); + MutableInt amtBoxes = new MutableInt(0); + voxelshape.forEachBox((x1, y1, z1, x2, y2, z2) -> amtBoxes.increment()); + double chance = 1d / amtBoxes.getValue(); + + voxelshape.forEachBox((x1, y1, z1, x2, y2, z2) -> { + double d1 = Math.min(1.0D, x2 - x1); + double d2 = Math.min(1.0D, y2 - y1); + double d3 = Math.min(1.0D, z2 - z1); + int i = Math.max(2, MathHelper.ceil(d1 / 0.25D)); + int j = Math.max(2, MathHelper.ceil(d2 / 0.25D)); + int k = Math.max(2, MathHelper.ceil(d3 / 0.25D)); + + for (int l = 0; l < i; ++l) { + for (int i1 = 0; i1 < j; ++i1) { + for (int j1 = 0; j1 < k; ++j1) { + if (world.rand.nextDouble() > chance) + continue; + + double d4 = ((double) l + 0.5D) / (double) i; + double d5 = ((double) i1 + 0.5D) / (double) j; + double d6 = ((double) j1 + 0.5D) / (double) k; + double d7 = d4 * d1 + x1; + double d8 = d5 * d2 + y1; + double d9 = d6 * d3 + z1; + manager + .addEffect((new DiggingParticle(world, (double) pos.getX() + d7, (double) pos.getY() + d8, + (double) pos.getZ() + d9, d4 - 0.5D, d5 - 0.5D, d6 - 0.5D, state)).setBlockPos(pos)); + } + } + } + + }); + } + public static int findAndRemoveInInventory(BlockState block, PlayerEntity player, int amount) { int amountFound = 0; Item required = getRequiredItem(block).getItem(); - boolean needsTwo = block.has(BlockStateProperties.SLAB_TYPE) - && block.get(BlockStateProperties.SLAB_TYPE) == SlabType.DOUBLE; + boolean needsTwo = + block.has(BlockStateProperties.SLAB_TYPE) && block.get(BlockStateProperties.SLAB_TYPE) == SlabType.DOUBLE; if (needsTwo) amount *= 2; @@ -36,7 +81,7 @@ public class BlockHelper { if (itemstack.getItem() == required && count > 0) { int taken = Math.min(count, amount - amountFound); player.inventory.setInventorySlotContents(preferredSlot, - new ItemStack(itemstack.getItem(), count - taken)); + new ItemStack(itemstack.getItem(), count - taken)); amountFound += taken; } } @@ -75,14 +120,15 @@ public class BlockHelper { } public static void destroyBlock(World world, BlockPos pos, float effectChance, - Consumer droppedItemCallback) { + Consumer droppedItemCallback) { IFluidState ifluidstate = world.getFluidState(pos); BlockState state = world.getBlockState(pos); if (world.rand.nextFloat() < effectChance) world.playEvent(2001, pos, Block.getStateId(state)); TileEntity tileentity = state.hasTileEntity() ? world.getTileEntity(pos) : null; - if (world.getGameRules().getBoolean(GameRules.DO_TILE_DROPS) && !world.restoringBlockSnapshots) { + if (world.getGameRules() + .getBoolean(GameRules.DO_TILE_DROPS) && !world.restoringBlockSnapshots) { for (ItemStack itemStack : Block.getDrops(state, (ServerWorld) world, pos, tileentity)) droppedItemCallback.accept(itemStack); state.spawnAdditionalDrops(world, pos, ItemStack.EMPTY); diff --git a/src/main/java/com/simibubi/create/foundation/utility/Couple.java b/src/main/java/com/simibubi/create/foundation/utility/Couple.java index 5645c30e6..fd391dbef 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/Couple.java +++ b/src/main/java/com/simibubi/create/foundation/utility/Couple.java @@ -1,38 +1,49 @@ package com.simibubi.create.foundation.utility; +import java.util.List; import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Consumer; import java.util.function.Function; +import com.google.common.base.Supplier; +import com.google.common.collect.ImmutableList; + +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.nbt.ListNBT; + public class Couple extends Pair { private static Couple TRUE_AND_FALSE = Couple.create(true, false); - + protected Couple(T first, T second) { super(first, second); } - + public static Couple create(T first, T second) { return new Couple<>(first, second); } - + + public static Couple create(Supplier factory) { + return new Couple<>(factory.get(), factory.get()); + } + public T get(boolean first) { return first ? getFirst() : getSecond(); } - + public void set(boolean first, T value) { if (first) setFirst(value); else setSecond(value); } - + @Override public Couple copy() { return create(first, second); } - + public Couple map(Function function) { return Couple.create(function.apply(first), function.apply(second)); } @@ -41,11 +52,11 @@ public class Couple extends Pair { setFirst(function.apply(getFirst())); setSecond(function.apply(getSecond())); } - + public void replaceWithContext(BiFunction function) { replaceWithParams(function, TRUE_AND_FALSE); } - + public void replaceWithParams(BiFunction function, Couple values) { setFirst(function.apply(getFirst(), values.getFirst())); setSecond(function.apply(getSecond(), values.getSecond())); @@ -55,18 +66,27 @@ public class Couple extends Pair { consumer.accept(getFirst()); consumer.accept(getSecond()); } - + public void forEachWithContext(BiConsumer consumer) { forEachWithParams(consumer, TRUE_AND_FALSE); } - + public void forEachWithParams(BiConsumer function, Couple values) { function.accept(getFirst(), values.getFirst()); function.accept(getSecond(), values.getSecond()); } - + public Couple swap() { return Couple.create(second, first); } - + + public ListNBT serializeEach(Function serializer) { + return NBTHelper.writeCompoundList(ImmutableList.of(first, second), serializer); + } + + public static Couple deserializeEach(ListNBT list, Function deserializer) { + List readCompoundList = NBTHelper.readCompoundList(list, deserializer); + return new Couple<>(readCompoundList.get(0), readCompoundList.get(1)); + } + } diff --git a/src/main/java/com/simibubi/create/foundation/utility/LerpedFloat.java b/src/main/java/com/simibubi/create/foundation/utility/LerpedFloat.java new file mode 100644 index 000000000..073f2fc07 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/utility/LerpedFloat.java @@ -0,0 +1,128 @@ +package com.simibubi.create.foundation.utility; + +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.util.math.MathHelper; + +// Can replace all Interpolated value classes +// InterpolatedChasingValue, InterpolatedValue, InterpolatedChasingAngle, InterpolatedAngle +public class LerpedFloat { + + Interpolater interpolater; + float previousValue; + float value; + + Chaser chaseFunction; + float chaseTarget; + float chaseSpeed; + + boolean forcedSync; + + public LerpedFloat(Interpolater interpolater) { + this.interpolater = interpolater; + startWithValue(0); + forcedSync = true; + } + + public static LerpedFloat linear() { + return new LerpedFloat((p, c, t) -> (float) MathHelper.lerp(p, c, t)); + } + + public static LerpedFloat angular() { + return new LerpedFloat(AngleHelper::angleLerp); + } + + public LerpedFloat startWithValue(double value) { + float f = (float) value; + this.previousValue = f; + this.chaseTarget = f; + this.value = f; + return this; + } + + public LerpedFloat chase(double value, double speed, Chaser chaseFunction) { + this.chaseTarget = (float) value; + this.chaseSpeed = (float) speed; + this.chaseFunction = chaseFunction; + return this; + } + + public boolean updateChaseSpeed(double speed) { + float prevSpeed = this.chaseSpeed; + this.chaseSpeed = (float) speed; + return !MathHelper.epsilonEquals(prevSpeed, speed); + } + + public void tickChaser() { + previousValue = value; + if (chaseFunction == null) + return; + if (MathHelper.epsilonEquals((double) value, chaseTarget)) { + value = chaseTarget; + return; + } + value = chaseFunction.chase(value, chaseSpeed, chaseTarget); + } + + public void setValue(double value) { + this.previousValue = this.value; + this.value = (float) value; + } + + public float getValue() { + return getValue(1); + } + + public float getValue(float partialTicks) { + return MathHelper.lerp(partialTicks, previousValue, value); + } + + public float getChaseTarget() { + return chaseTarget; + } + + public void forceNextSync() { + forcedSync = true; + } + + public CompoundNBT writeNBT() { + CompoundNBT compoundNBT = new CompoundNBT(); + compoundNBT.putFloat("Speed", chaseSpeed); + compoundNBT.putFloat("Target", chaseTarget); + compoundNBT.putFloat("Value", value); + if (forcedSync) + compoundNBT.putBoolean("Force", true); + forcedSync = false; + return compoundNBT; + } + + public void readNBT(CompoundNBT compoundNBT, boolean clientPacket) { + if (!clientPacket || compoundNBT.contains("Force")) + startWithValue(compoundNBT.getFloat("Value")); + readChaser(compoundNBT); + } + + private void readChaser(CompoundNBT compoundNBT) { + chaseSpeed = compoundNBT.getFloat("Speed"); + chaseTarget = compoundNBT.getFloat("Target"); + } + + @FunctionalInterface + public interface Interpolater { + float interpolate(double progress, double current, double target); + } + + @FunctionalInterface + public interface Chaser { + + public static final Chaser IDLE = (c, s, t) -> (float) c; + public static final Chaser EXP = exp(Double.MAX_VALUE); + public static final Chaser LINEAR = (c, s, t) -> (float) (c + MathHelper.clamp(t - c, -s, s)); + + public static Chaser exp(double maxEffectiveSpeed) { + return (c, s, t) -> (float) (c + MathHelper.clamp((t - c) * s, -maxEffectiveSpeed, maxEffectiveSpeed)); + } + + float chase(double current, double speed, double target); + } + +} diff --git a/src/main/java/com/simibubi/create/foundation/utility/VecHelper.java b/src/main/java/com/simibubi/create/foundation/utility/VecHelper.java index 99fbffc69..d5cac157a 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/VecHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/VecHelper.java @@ -68,10 +68,14 @@ public class VecHelper { vec.z + (r.nextFloat() - .5f) * 2 * radius); } - public static Vec3d planeByNormal(Vec3d vec) { + public static Vec3d axisAlingedPlaneOf(Vec3d vec) { vec = vec.normalize(); return new Vec3d(1, 1, 1).subtract(Math.abs(vec.x), Math.abs(vec.y), Math.abs(vec.z)); } + + public static Vec3d axisAlingedPlaneOf(Direction face) { + return axisAlingedPlaneOf(new Vec3d(face.getDirectionVec())); + } public static ListNBT writeNBT(Vec3d vec) { ListNBT listnbt = new ListNBT(); @@ -114,12 +118,17 @@ public class VecHelper { .scale(maxLength) : vec; } + public static Vec3d clampComponentWise(Vec3d vec, float maxLength) { + return new Vec3d(MathHelper.clamp(vec.x, -maxLength, maxLength), MathHelper.clamp(vec.y, -maxLength, maxLength), + MathHelper.clamp(vec.z, -maxLength, maxLength)); + } + public static Vec3d project(Vec3d vec, Vec3d ontoVec) { if (ontoVec.equals(Vec3d.ZERO)) return Vec3d.ZERO; return ontoVec.scale(vec.dotProduct(ontoVec) / ontoVec.lengthSquared()); } - + @Nullable public static Vec3d intersectSphere(Vec3d origin, Vec3d lineDirection, Vec3d sphereCenter, double radius) { if (lineDirection.equals(Vec3d.ZERO)) diff --git a/src/main/java/com/simibubi/create/foundation/utility/outliner/BlockClusterOutline.java b/src/main/java/com/simibubi/create/foundation/utility/outliner/BlockClusterOutline.java index 014d8c8ac..06f7beb9f 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/outliner/BlockClusterOutline.java +++ b/src/main/java/com/simibubi/create/foundation/utility/outliner/BlockClusterOutline.java @@ -58,7 +58,7 @@ public class BlockClusterOutline extends Outline { Vec3d center = VecHelper.getCenterOf(pos); Vec3d offset = new Vec3d(face.getDirectionVec()); - Vec3d plane = VecHelper.planeByNormal(offset); + Vec3d plane = VecHelper.axisAlingedPlaneOf(offset); Axis axis = face.getAxis(); offset = offset.scale(1 / 2f + 1 / 64d); diff --git a/src/main/java/com/simibubi/create/foundation/utility/outliner/Outline.java b/src/main/java/com/simibubi/create/foundation/utility/outliner/Outline.java index a8dcb297a..d7ad3d190 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/outliner/Outline.java +++ b/src/main/java/com/simibubi/create/foundation/utility/outliner/Outline.java @@ -61,7 +61,7 @@ public abstract class Outline { float lineWidth = params.getLineWidth(); Vec3d extension = diff.normalize() .scale(lineWidth / 2); - Vec3d plane = VecHelper.planeByNormal(diff); + Vec3d plane = VecHelper.axisAlingedPlaneOf(diff); Direction face = Direction.getFacingFromVector(diff.x, diff.y, diff.z); Axis axis = face.getAxis(); diff --git a/src/main/java/com/simibubi/create/foundation/utility/outliner/Outliner.java b/src/main/java/com/simibubi/create/foundation/utility/outliner/Outliner.java index 67ee4f80b..07c7a55cf 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/outliner/Outliner.java +++ b/src/main/java/com/simibubi/create/foundation/utility/outliner/Outliner.java @@ -1,5 +1,6 @@ package com.simibubi.create.foundation.utility.outliner; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -110,7 +111,7 @@ public class Outliner { // Maintenance public Outliner() { - outlines = new HashMap<>(); + outlines = Collections.synchronizedMap(new HashMap<>()); } public void tickOutlines() { diff --git a/src/main/resources/assets/create/lang/default/advancements.json b/src/main/resources/assets/create/lang/default/advancements.json index 9efbca048..ea54a7ea9 100644 --- a/src/main/resources/assets/create/lang/default/advancements.json +++ b/src/main/resources/assets/create/lang/default/advancements.json @@ -39,7 +39,7 @@ "advancement.create.electron_tube": "Beep boop", "advancement.create.electron_tube.desc": "Make some Electron Tubes, useful in crafting less primitive machinery.", "advancement.create.mechanical_saw": "Stationary Chopping", - "advancement.create.mechanical_saw.desc": "Place and power a Mechanical mechanical_saw", + "advancement.create.mechanical_saw.desc": "Place and power a Mechanical Saw", "advancement.create.basin": "Basin Operation", "advancement.create.basin.desc": "Place a basin and try throwing items into it.", "advancement.create.mixer": "Mixin' it Up", diff --git a/src/main/resources/assets/create/lang/default/messages.json b/src/main/resources/assets/create/lang/default/messages.json index bd91c8762..7868655e1 100644 --- a/src/main/resources/assets/create/lang/default/messages.json +++ b/src/main/resources/assets/create/lang/default/messages.json @@ -7,7 +7,7 @@ "death.attack.create.fan_fire": "%1$s was burned to death by hot air", "death.attack.create.fan_lava": "%1$s was burned to death by lava fan", "death.attack.create.mechanical_drill": "%1$s was impaled by Mechanical mechanical_drill", - "death.attack.create.mechanical_saw": "%1$s got cut in half by Mechanical mechanical_saw", + "death.attack.create.mechanical_saw": "%1$s got cut in half by Mechanical Saw", "death.attack.create.cuckoo_clock_explosion": "%1$s was blown up by tampered cuckoo clock", "create.block.deployer.damage_source_name": "a rogue Deployer", "create.block.cart_assembler.invalid": "Place your Cart Assembler on a rail block", @@ -23,7 +23,7 @@ "create.recipe.pressing": "Pressing", "create.recipe.mixing": "Mixing", "create.recipe.packing": "Compacting", - "create.recipe.mechanical_sawing": "mechanical_sawing", + "create.recipe.mechanical_sawing": "Sawing", "create.recipe.mechanical_crafting": "Mechanical Crafting", "create.recipe.block_cutting": "Block Cutting", "create.recipe.blockzapper_upgrade": "Handheld Blockzapper", diff --git a/src/main/resources/assets/create/models/block/basin.json b/src/main/resources/assets/create/models/block/basin.json index 95bc5feaa..aa5e251cd 100644 --- a/src/main/resources/assets/create/models/block/basin.json +++ b/src/main/resources/assets/create/models/block/basin.json @@ -10,13 +10,13 @@ { "name": "Side1", "from": [0, 2, 0], - "to": [2, 13, 16], + "to": [2, 16, 16], "rotation": {"angle": 0, "axis": "y", "origin": [8, 24, 8]}, "faces": { - "north": {"uv": [14, 3, 16, 14], "texture": "#1"}, - "east": {"uv": [0, 3, 16, 14], "texture": "#1"}, - "south": {"uv": [0, 3, 2, 14], "texture": "#1"}, - "west": {"uv": [0, 3, 16, 14], "texture": "#1"}, + "north": {"uv": [14, 0, 16, 14], "texture": "#1"}, + "east": {"uv": [0, 0, 16, 14], "texture": "#1"}, + "south": {"uv": [0, 0, 2, 14], "texture": "#1"}, + "west": {"uv": [0, 0, 16, 14], "texture": "#1"}, "up": {"uv": [0, 0, 2, 16], "texture": "#12"}, "down": {"uv": [0, 0, 2, 16], "texture": "#12"} } @@ -38,11 +38,11 @@ { "name": "Side4", "from": [2, 2, 0], - "to": [14, 13, 2], + "to": [14, 16, 2], "rotation": {"angle": 0, "axis": "y", "origin": [8, 24, 8]}, "faces": { - "north": {"uv": [2, 3, 14, 14], "texture": "#1"}, - "south": {"uv": [2, 3, 14, 14], "texture": "#1"}, + "north": {"uv": [2, 0, 14, 14], "texture": "#1"}, + "south": {"uv": [2, 0, 14, 14], "texture": "#1"}, "up": {"uv": [2, 0, 14, 2], "texture": "#12"}, "down": {"uv": [2, 14, 14, 16], "texture": "#12"} } @@ -50,11 +50,11 @@ { "name": "Side2", "from": [2, 2, 14], - "to": [14, 13, 16], + "to": [14, 16, 16], "rotation": {"angle": 0, "axis": "y", "origin": [8, 24, 8]}, "faces": { - "north": {"uv": [2, 3, 14, 14], "texture": "#1"}, - "south": {"uv": [2, 3, 14, 14], "texture": "#1"}, + "north": {"uv": [2, 0, 14, 14], "texture": "#1"}, + "south": {"uv": [2, 0, 14, 14], "texture": "#1"}, "up": {"uv": [2, 14, 14, 16], "texture": "#12"}, "down": {"uv": [2, 0, 14, 2], "texture": "#12"} } @@ -62,13 +62,13 @@ { "name": "Side3", "from": [14, 2, 0], - "to": [16, 13, 16], + "to": [16, 16, 16], "rotation": {"angle": 0, "axis": "y", "origin": [8, 40, 8]}, "faces": { - "north": {"uv": [0, 3, 2, 14], "texture": "#1"}, - "east": {"uv": [0, 3, 16, 14], "texture": "#1"}, - "south": {"uv": [14, 3, 16, 14], "texture": "#1"}, - "west": {"uv": [0, 3, 16, 14], "texture": "#1"}, + "north": {"uv": [0, 0, 2, 14], "texture": "#1"}, + "east": {"uv": [0, 0, 16, 14], "texture": "#1"}, + "south": {"uv": [14, 0, 16, 14], "texture": "#1"}, + "west": {"uv": [0, 0, 16, 14], "texture": "#1"}, "up": {"uv": [14, 0, 16, 16], "texture": "#12"}, "down": {"uv": [14, 0, 16, 16], "texture": "#12"} } diff --git a/src/main/resources/assets/create/models/block/chute/block_diagonal.json b/src/main/resources/assets/create/models/block/chute/block_diagonal.json index 7f7428bce..d2bdace75 100644 --- a/src/main/resources/assets/create/models/block/chute/block_diagonal.json +++ b/src/main/resources/assets/create/models/block/chute/block_diagonal.json @@ -2,151 +2,56 @@ "credit": "Made with Blockbench", "parent": "block/block", "textures": { - "2": "create:block/chute_diagonal", - "13": "create:block/chute", - "particle": "block/hopper_outside" + "0": "create:block/chute", + "1": "create:block/chute_diagonal", + "particle": "block/hopper_inside" }, "elements": [ { - "from": [2, 8, 2], - "to": [14, 16, 14], + "from": [1.1, -11, 2], + "to": [14.9, 0, 16], + "rotation": {"angle": 45, "axis": "x", "origin": [8, 0, 16]}, "faces": { - "north": {"uv": [9, 4, 15, 8], "rotation": 180, "texture": "#13"}, - "east": {"uv": [9, 4, 15, 8], "rotation": 180, "texture": "#13"}, - "south": {"uv": [9, 4, 15, 8], "rotation": 180, "texture": "#13"}, - "west": {"uv": [9, 4, 15, 8], "rotation": 180, "texture": "#13"}, - "up": {"uv": [5, 10, 11, 16], "texture": "#2"}, - "down": {"uv": [9, 11, 15, 15], "texture": "#13"} + "north": {"uv": [8.5, 8.5, 15.5, 14], "texture": "#1"}, + "east": {"uv": [8.5, 8.5, 15.5, 14], "texture": "#1"}, + "south": {"uv": [8.5, 8.5, 15.5, 14], "texture": "#1"}, + "west": {"uv": [8.5, 8.5, 15.5, 14], "texture": "#1"}, + "up": {"uv": [8.5, 8.5, 15.5, 15.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [8.5, 8.5, 15.5, 15.5], "rotation": 180, "texture": "#0"} } }, { - "from": [2, 5.5, 2], - "to": [14, 8, 14], + "from": [4, -16, -2], + "to": [12, -4.4, 0], + "rotation": {"angle": 45, "axis": "x", "origin": [8, -16, 0]}, "faces": { - "north": {"uv": [9, 10.5, 15, 14.5], "rotation": 180, "texture": "#13"}, - "east": {"uv": [14.25, 5, 15.5, 11], "rotation": 270, "texture": "#2"}, - "south": {"uv": [14.25, 5, 15.5, 11], "rotation": 270, "texture": "#2"}, - "west": {"uv": [14.25, 5, 15.5, 11], "rotation": 270, "texture": "#2"}, - "up": {"uv": [9, 9.5, 15, 15.5], "texture": "#13"}, - "down": {"uv": [9, 11, 15, 15], "texture": "#13"} + "east": {"uv": [6, 8.5, 7, 14.5], "texture": "#1"}, + "south": {"uv": [2, 8.5, 6, 14.5], "texture": "#1"}, + "west": {"uv": [1, 8.5, 2, 14.5], "texture": "#1"}, + "down": {"uv": [0, 0, 8, 2], "rotation": 180, "texture": "#1"} } }, { - "from": [1.9, -12, 7.9], - "to": [14.1, 10.666, 14.1], - "rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]}, + "from": [2.1, -16, -7], + "to": [13.9, -4.4, -2], + "rotation": {"angle": 45, "axis": "x", "origin": [8, -16, 0]}, "faces": { - "north": {"uv": [0, 10, 11, 16], "rotation": 270, "texture": "#2"}, - "east": {"uv": [13, 11, 16, 0], "texture": "#2"}, - "south": {"uv": [0, 10, 11, 16], "rotation": 270, "texture": "#2"}, - "west": {"uv": [13, 0, 16, 11], "rotation": 180, "texture": "#2"}, - "up": {"uv": [5, 10, 11, 13], "rotation": 180, "texture": "#2"} + "east": {"uv": [9, 1, 11.5, 7], "texture": "#1"}, + "south": {"uv": [9, 1, 15, 7], "texture": "#1"}, + "west": {"uv": [12.5, 1, 15, 7], "texture": "#1"}, + "down": {"uv": [9, 12.5, 15, 15], "rotation": 180, "texture": "#0"} } }, { - "from": [3, 13, 3], - "to": [13, 14, 13], + "from": [2.1, -16, -13], + "to": [13.9, -4.4, -7], + "rotation": {"angle": 45, "axis": "x", "origin": [8, -16, 0]}, "faces": { - "up": {"uv": [11, 11, 16, 16], "rotation": 180, "texture": "#2"} + "north": {"uv": [9, 1, 15, 7], "texture": "#1"}, + "east": {"uv": [11.5, 1, 15, 7], "texture": "#1"}, + "west": {"uv": [9, 1, 12.5, 7], "texture": "#1"}, + "down": {"uv": [9, 9, 15, 12], "rotation": 180, "texture": "#0"} } - }, - { - "from": [1.1, -12, 1.9], - "to": [14.9, 10.666, 8.1], - "rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [0, 3, 11, 10], "rotation": 90, "texture": "#2"}, - "east": {"uv": [0, 0, 11, 3], "rotation": 270, "texture": "#2"}, - "south": {"uv": [0, 3, 11, 10], "rotation": 90, "texture": "#2"}, - "west": {"uv": [0, 0, 11, 3], "rotation": 90, "texture": "#2"}, - "up": {"uv": [8.5, 0, 15.5, 3], "rotation": 180, "texture": "#13"} - } - } - ], - "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.25, 0], - "scale": [0.25, 0.25, 0.25] - }, - "gui": { - "rotation": [30, 225, 0], - "translation": [0, 1, 0], - "scale": [0.5, 0.5, 0.5] - }, - "head": { - "rotation": [0, 90, 0] - }, - "fixed": { - "rotation": [0, 90, 0], - "translation": [0, 1.5, 0], - "scale": [0.5, 0.5, 0.5] - } - }, - "groups": [ - { - "name": "group", - "origin": [8, 24, -24], - "children": [0] - }, - { - "name": "alt_block_diagonal_start", - "origin": [8, 8, 8], - "children": [ - { - "name": "group", - "origin": [8, 56, -56], - "children": [1] - }, - { - "name": "alt_block_diagonal_straight", - "origin": [8, 8, 8], - "children": [ - { - "name": "group", - "origin": [8, 8, -8], - "children": [2] - }, - { - "name": "group", - "origin": [8, 8, -8], - "children": [] - } - ] - }, 3] - }, - { - "name": "alt_block_diagonal_straight", - "origin": [8, 8, 8], - "children": [ - { - "name": "group", - "origin": [8, 8, -8], - "children": [4] - }, - { - "name": "group", - "origin": [8, 8, -8], - "children": [] - } - ] } ] } \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/chute/block_diagonal_intersection.json b/src/main/resources/assets/create/models/block/chute/block_diagonal_intersection.json new file mode 100644 index 000000000..8dc512a03 --- /dev/null +++ b/src/main/resources/assets/create/models/block/chute/block_diagonal_intersection.json @@ -0,0 +1,121 @@ +{ + "credit": "Made with Blockbench", + "parent": "block/block", + "textures": { + "0": "create:block/chute", + "1": "create:block/chute_diagonal", + "particle": "block/hopper_inside" + }, + "elements": [ + { + "from": [1.1, -11, 2], + "to": [14.9, 0, 16], + "rotation": {"angle": 45, "axis": "x", "origin": [8, 0, 16]}, + "faces": { + "north": {"uv": [8.5, 8.5, 15.5, 14], "texture": "#1"}, + "east": {"uv": [8.5, 8.5, 15.5, 14], "texture": "#1"}, + "south": {"uv": [8.5, 8.5, 15.5, 14], "texture": "#1"}, + "west": {"uv": [8.5, 8.5, 15.5, 14], "texture": "#1"}, + "up": {"uv": [8.5, 8.5, 15.5, 15.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [8.5, 8.5, 15.5, 15.5], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [4, -16, -2], + "to": [12, -4.4, 0], + "rotation": {"angle": 45, "axis": "x", "origin": [8, -16, 0]}, + "faces": { + "east": {"uv": [6, 8.5, 7, 14.5], "texture": "#1"}, + "south": {"uv": [2, 8.5, 6, 14.5], "texture": "#1"}, + "west": {"uv": [1, 8.5, 2, 14.5], "texture": "#1"}, + "down": {"uv": [0, 0, 8, 2], "rotation": 180, "texture": "#1"} + } + }, + { + "from": [2.1, -16, -7], + "to": [13.9, -4.4, -2], + "rotation": {"angle": 45, "axis": "x", "origin": [8, -16, 0]}, + "faces": { + "east": {"uv": [9, 1, 11.5, 7], "texture": "#1"}, + "south": {"uv": [9, 1, 15, 7], "texture": "#1"}, + "west": {"uv": [12.5, 1, 15, 7], "texture": "#1"}, + "down": {"uv": [9, 12.5, 15, 15], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [2.1, -16, -13], + "to": [13.9, -4.4, -7], + "rotation": {"angle": 45, "axis": "x", "origin": [8, -16, 0]}, + "faces": { + "north": {"uv": [9, 1, 15, 7], "texture": "#1"}, + "east": {"uv": [11.5, 1, 15, 7], "texture": "#1"}, + "west": {"uv": [9, 1, 12.5, 7], "texture": "#1"}, + "down": {"uv": [9, 9, 15, 12], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [0, 0, 0], + "to": [3, 16, 16], + "faces": { + "north": {"uv": [6.5, 0, 8, 8], "texture": "#1"}, + "east": {"uv": [8, 0, 16, 8], "texture": "#0"}, + "south": {"uv": [0, 0, 1.5, 8], "texture": "#1"}, + "west": {"uv": [0, 0, 8, 8], "texture": "#1"}, + "up": {"uv": [8, 8, 9.5, 16], "texture": "#0"}, + "down": {"uv": [14.5, 8, 16, 16], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [13, 0, 0], + "to": [16, 16, 16], + "faces": { + "north": {"uv": [0, 0, 1.5, 8], "texture": "#1"}, + "east": {"uv": [0, 0, 8, 8], "texture": "#1"}, + "south": {"uv": [6.5, 0, 8, 8], "texture": "#1"}, + "west": {"uv": [8, 0, 16, 8], "texture": "#0"}, + "up": {"uv": [8, 8, 9.5, 16], "rotation": 180, "texture": "#0"}, + "down": {"uv": [14.5, 8, 16, 16], "texture": "#0"} + } + }, + { + "from": [3, 0, 0], + "to": [13, 16, 3], + "faces": { + "north": {"uv": [1.5, 0, 6.5, 8], "texture": "#1"}, + "east": {"uv": [6.5, 0, 8, 8], "texture": "#1"}, + "south": {"uv": [9.5, 0, 14.5, 8], "texture": "#0"}, + "west": {"uv": [0, 0, 1.5, 8], "texture": "#1"}, + "up": {"uv": [14.5, 9.5, 16, 14.5], "rotation": 270, "texture": "#0"}, + "down": {"uv": [14.5, 9.5, 16, 14.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [3, 0, 13], + "to": [13, 16, 16], + "faces": { + "north": {"uv": [9.5, 0, 14.5, 8], "texture": "#0"}, + "east": {"uv": [0, 0, 1.5, 8], "texture": "#1"}, + "south": {"uv": [1.5, 0, 6.5, 8], "texture": "#1"}, + "west": {"uv": [6.5, 0, 8, 8], "texture": "#1"}, + "up": {"uv": [14.5, 9.5, 16, 14.5], "rotation": 90, "texture": "#0"}, + "down": {"uv": [14.5, 9.5, 16, 14.5], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [3, 8, 3], + "to": [13, 14, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [11, -6, 11]}, + "faces": { + "up": {"uv": [9.5, 9.5, 14.5, 14.5], "texture": "#0"}, + "down": {"uv": [9.5, 9.5, 14.5, 14.5], "texture": "#0"} + } + } + ], + "groups": [0, 1, 2, 3, + { + "name": "intersection", + "origin": [8, 8, 8], + "children": [4, 5, 6, 7, 8] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/chute/block_diagonal_start.json b/src/main/resources/assets/create/models/block/chute/block_diagonal_start.json deleted file mode 100644 index 8b53f63c6..000000000 --- a/src/main/resources/assets/create/models/block/chute/block_diagonal_start.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "credit": "Made with Blockbench", - "parent": "block/block", - "textures": { - "2": "create:block/chute_diagonal", - "13": "create:block/chute", - "particle": "block/hopper_outside" - }, - "elements": [ - { - "from": [3, 8, 13], - "to": [13, 16, 15], - "faces": { - "north": {"uv": [9.5, 0, 14.5, 4], "texture": "#13"}, - "south": {"uv": [9.5, 0, 14.5, 4], "texture": "#13"}, - "up": {"uv": [1, 0, 6, 1], "rotation": 180, "texture": "#13"}, - "down": {"uv": [1, 6, 6, 7], "rotation": 180, "texture": "#13"} - } - }, - { - "from": [3, 8, 1], - "to": [13, 16, 3], - "faces": { - "north": {"uv": [9.5, 0, 14.5, 4], "texture": "#13"}, - "south": {"uv": [9.5, 0, 14.5, 4], "texture": "#13"}, - "up": {"uv": [1, 0, 6, 1], "texture": "#13"}, - "down": {"uv": [1, 6, 6, 7], "texture": "#13"} - } - }, - { - "from": [13, 8, 1], - "to": [15, 16, 15], - "faces": { - "north": {"uv": [8.5, 0, 9.5, 4], "texture": "#13"}, - "east": {"uv": [8.5, 0, 15.5, 4], "texture": "#13"}, - "south": {"uv": [14.5, 0, 15.5, 4], "texture": "#13"}, - "west": {"uv": [8.5, 0, 15.5, 4], "texture": "#13"}, - "up": {"uv": [0, 0, 1, 7], "rotation": 180, "texture": "#13"}, - "down": {"uv": [0, 0, 1, 7], "rotation": 180, "texture": "#13"} - } - }, - { - "from": [1, 8, 1], - "to": [3, 16, 15], - "faces": { - "north": {"uv": [14.5, 0, 15.5, 4], "texture": "#13"}, - "east": {"uv": [8.5, 0, 15.5, 4], "texture": "#13"}, - "south": {"uv": [8.5, 0, 9.5, 4], "texture": "#13"}, - "west": {"uv": [8.5, 0, 15.5, 4], "texture": "#13"}, - "up": {"uv": [0, 0, 1, 7], "texture": "#13"}, - "down": {"uv": [0, 0, 1, 7], "texture": "#13"} - } - }, - { - "from": [2, 5.5, 2], - "to": [14, 8, 14], - "faces": { - "north": {"uv": [9, 10.5, 15, 14.5], "rotation": 180, "texture": "#13"}, - "east": {"uv": [14.25, 5, 15.5, 11], "rotation": 270, "texture": "#2"}, - "south": {"uv": [14.25, 5, 15.5, 11], "rotation": 270, "texture": "#2"}, - "west": {"uv": [14.25, 5, 15.5, 11], "rotation": 270, "texture": "#2"}, - "up": {"uv": [9, 9.5, 15, 15.5], "texture": "#13"}, - "down": {"uv": [9, 11, 15, 15], "texture": "#13"} - } - }, - { - "from": [1.9, -12, 7.9], - "to": [14.1, 10.666, 14.1], - "rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [0, 10, 11, 16], "rotation": 270, "texture": "#2"}, - "east": {"uv": [13, 11, 16, 0], "texture": "#2"}, - "south": {"uv": [0, 10, 11, 16], "rotation": 270, "texture": "#2"}, - "west": {"uv": [13, 0, 16, 11], "rotation": 180, "texture": "#2"}, - "up": {"uv": [5, 10, 11, 13], "rotation": 180, "texture": "#2"} - } - }, - { - "from": [1.1, -12, 1.9], - "to": [14.9, 8.666, 8.1], - "rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [1, 3, 11, 10], "rotation": 90, "texture": "#2"}, - "east": {"uv": [0, 0, 10, 3], "rotation": 270, "texture": "#2"}, - "south": {"uv": [1, 3, 11, 10], "rotation": 90, "texture": "#2"}, - "west": {"uv": [1, 0, 11, 3], "rotation": 90, "texture": "#2"} - } - }, - { - "from": [3, 13, 3], - "to": [13, 14, 13], - "faces": { - "up": {"uv": [9.5, 9.5, 14.5, 14.5], "rotation": 180, "texture": "#13"} - } - } - ], - "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.25, 0], - "scale": [0.25, 0.25, 0.25] - }, - "gui": { - "rotation": [30, 225, 0], - "translation": [0, 1, 0], - "scale": [0.5, 0.5, 0.5] - }, - "head": { - "rotation": [0, 90, 0] - }, - "fixed": { - "rotation": [0, 90, 0], - "translation": [0, 1.5, 0], - "scale": [0.5, 0.5, 0.5] - } - }, - "groups": [ - { - "name": "group", - "origin": [8, 56, -56], - "children": [0, 1, 2, 3, 4] - }, - { - "name": "alt_block_diagonal_straight", - "origin": [8, 8, 8], - "children": [ - { - "name": "group", - "origin": [8, 8, -8], - "children": [5, 6] - }, - { - "name": "group", - "origin": [8, 8, -8], - "children": [] - } - ] - }, 7] -} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/chute/block_diagonal_straight.json b/src/main/resources/assets/create/models/block/chute/block_diagonal_straight.json deleted file mode 100644 index d6d05dd68..000000000 --- a/src/main/resources/assets/create/models/block/chute/block_diagonal_straight.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "credit": "Made with Blockbench", - "parent": "block/block", - "textures": { - "2": "create:block/chute_diagonal", - "13": "create:block/chute", - "particle": "block/hopper_outside" - }, - "elements": [ - { - "from": [1.9, -12, 7.9], - "to": [14.1, 10.666, 14.1], - "rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [6, 10, 9, 16], "rotation": 90, "texture": "#13"}, - "east": {"uv": [13, 11, 16, 0], "texture": "#2"}, - "south": {"uv": [0, 10, 11, 16], "rotation": 270, "texture": "#2"}, - "west": {"uv": [13, 0, 16, 11], "rotation": 180, "texture": "#2"} - } - }, - { - "from": [1.1, -12, 1.9], - "to": [14.9, 10.666, 8.1], - "rotation": {"angle": 45, "axis": "x", "origin": [8, 8, 8]}, - "faces": { - "north": {"uv": [0, 3, 11, 10], "rotation": 90, "texture": "#2"}, - "east": {"uv": [0, 0, 11, 3], "rotation": 270, "texture": "#2"}, - "south": {"uv": [0, 3, 11, 10], "rotation": 90, "texture": "#2"}, - "west": {"uv": [0, 0, 11, 3], "rotation": 90, "texture": "#2"} - } - } - ], - "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.25, 0], - "scale": [0.25, 0.25, 0.25] - }, - "gui": { - "rotation": [30, 225, 0], - "translation": [0, 1, 0], - "scale": [0.5, 0.5, 0.5] - }, - "head": { - "rotation": [0, 90, 0] - }, - "fixed": { - "rotation": [0, 90, 0], - "translation": [0, 1.5, 0], - "scale": [0.5, 0.5, 0.5] - } - }, - "groups": [ - { - "name": "group", - "origin": [8, 8, -8], - "children": [0, 1] - }, - { - "name": "group", - "origin": [8, 8, -8], - "children": [] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/chute/block_intersection.json b/src/main/resources/assets/create/models/block/chute/block_intersection.json new file mode 100644 index 000000000..0c2f7f382 --- /dev/null +++ b/src/main/resources/assets/create/models/block/chute/block_intersection.json @@ -0,0 +1,67 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "create:block/chute", + "1": "create:block/chute_diagonal", + "particle": "block/hopper_inside" + }, + "elements": [ + { + "from": [0, 0, 0], + "to": [3, 16, 16], + "faces": { + "north": {"uv": [6.5, 0, 8, 8], "texture": "#1"}, + "east": {"uv": [8, 0, 16, 8], "texture": "#0"}, + "south": {"uv": [0, 0, 1.5, 8], "texture": "#1"}, + "west": {"uv": [0, 0, 8, 8], "texture": "#1"}, + "up": {"uv": [8, 8, 9.5, 16], "texture": "#0"}, + "down": {"uv": [14.5, 8, 16, 16], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [13, 0, 0], + "to": [16, 16, 16], + "faces": { + "north": {"uv": [0, 0, 1.5, 8], "texture": "#1"}, + "east": {"uv": [0, 0, 8, 8], "texture": "#1"}, + "south": {"uv": [6.5, 0, 8, 8], "texture": "#1"}, + "west": {"uv": [8, 0, 16, 8], "texture": "#0"}, + "up": {"uv": [8, 8, 9.5, 16], "rotation": 180, "texture": "#0"}, + "down": {"uv": [14.5, 8, 16, 16], "texture": "#0"} + } + }, + { + "from": [3, 0, 0], + "to": [13, 16, 3], + "faces": { + "north": {"uv": [1.5, 0, 6.5, 8], "texture": "#1"}, + "east": {"uv": [6.5, 0, 8, 8], "texture": "#1"}, + "south": {"uv": [9.5, 0, 14.5, 8], "texture": "#0"}, + "west": {"uv": [0, 0, 1.5, 8], "texture": "#1"}, + "up": {"uv": [14.5, 9.5, 16, 14.5], "rotation": 270, "texture": "#0"}, + "down": {"uv": [14.5, 9.5, 16, 14.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [3, 0, 13], + "to": [13, 16, 16], + "faces": { + "north": {"uv": [9.5, 0, 14.5, 8], "texture": "#0"}, + "east": {"uv": [0, 0, 1.5, 8], "texture": "#1"}, + "south": {"uv": [1.5, 0, 6.5, 8], "texture": "#1"}, + "west": {"uv": [6.5, 0, 8, 8], "texture": "#1"}, + "up": {"uv": [14.5, 9.5, 16, 14.5], "rotation": 90, "texture": "#0"}, + "down": {"uv": [14.5, 9.5, 16, 14.5], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [3, 8, 3], + "to": [13, 14, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [11, -6, 11]}, + "faces": { + "up": {"uv": [9.5, 9.5, 14.5, 14.5], "texture": "#0"}, + "down": {"uv": [9.5, 9.5, 14.5, 14.5], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/creative_motor/block.json b/src/main/resources/assets/create/models/block/creative_motor/block.json index c331a7455..5c1420dae 100644 --- a/src/main/resources/assets/create/models/block/creative_motor/block.json +++ b/src/main/resources/assets/create/models/block/creative_motor/block.json @@ -42,11 +42,11 @@ "to": [11, 11, 13], "faces": { "north": {"uv": [14, 4, 20, 10], "texture": "#6"}, - "east": {"uv": [10, 6, 16, 10], "rotation": 90, "texture": "#6"}, + "east": {"uv": [10, 6, 16, 10], "rotation": 270, "texture": "#6"}, "south": {"uv": [10, 0, 16, 6], "texture": "#6"}, - "west": {"uv": [10, 6, 16, 10], "rotation": 270, "texture": "#6"}, - "up": {"uv": [10, 6, 16, 10], "texture": "#6"}, - "down": {"uv": [10, 6, 16, 10], "rotation": 180, "texture": "#6"} + "west": {"uv": [10, 6, 16, 10], "rotation": 90, "texture": "#6"}, + "up": {"uv": [10, 6, 16, 10], "rotation": 180, "texture": "#6"}, + "down": {"uv": [10, 6, 16, 10], "texture": "#6"} } }, { @@ -63,14 +63,14 @@ { "name": "Body", "from": [4, 4, 2], - "to": [12, 12, 10], + "to": [12, 12, 11], "faces": { "north": {"uv": [0, 4, 8, 14], "rotation": 180, "texture": "#5"}, - "east": {"uv": [4, 3, 12, 13], "rotation": 180, "texture": "#5"}, + "east": {"uv": [4, 3, 12, 12], "rotation": 270, "texture": "#5"}, "south": {"uv": [3, 3, 11, 11], "rotation": 180, "texture": "#5"}, - "west": {"uv": [4, 3, 12, 13], "rotation": 180, "texture": "#5"}, - "up": {"uv": [4, 3, 12, 13], "rotation": 180, "texture": "#5"}, - "down": {"uv": [4, 3, 12, 13], "rotation": 180, "texture": "#5"} + "west": {"uv": [4, 3, 12, 12], "rotation": 90, "texture": "#5"}, + "up": {"uv": [4, 3, 12, 12], "rotation": 180, "texture": "#5"}, + "down": {"uv": [4, 3, 12, 12], "rotation": 180, "texture": "#5"} } }, { diff --git a/src/main/resources/assets/create/models/block/creative_motor/block_vertical.json b/src/main/resources/assets/create/models/block/creative_motor/block_vertical.json index a1924a082..d47a8bc71 100644 --- a/src/main/resources/assets/create/models/block/creative_motor/block_vertical.json +++ b/src/main/resources/assets/create/models/block/creative_motor/block_vertical.json @@ -10,19 +10,6 @@ "particle": "#5" }, "elements": [ - { - "name": "Back", - "from": [3, 0.1, 3], - "to": [13, 2.1, 13], - "faces": { - "north": {"uv": [3, 0, 13, 2], "rotation": 180, "texture": "#5"}, - "east": {"uv": [3, 0, 13, 2], "rotation": 180, "texture": "#5"}, - "south": {"uv": [3, 0, 13, 2], "rotation": 180, "texture": "#5"}, - "west": {"uv": [3, 0, 13, 2], "rotation": 180, "texture": "#5"}, - "up": {"uv": [0, 0, 10, 10], "texture": "#6"}, - "down": {"uv": [0, 0, 10, 10], "rotation": 180, "texture": "#6"} - } - }, { "name": "Back", "from": [3, 12, 3], @@ -51,8 +38,9 @@ }, { "name": "Between Rims", - "from": [3.5, 3, 3.5], - "to": [12.5, 6, 12.5], + "from": [3.5, 5, 3.5], + "to": [12.5, 8, 12.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 10, 8]}, "faces": { "north": {"uv": [3, 10, 12, 13], "texture": "#6"}, "east": {"uv": [3, 10, 12, 13], "texture": "#6"}, @@ -63,110 +51,74 @@ { "name": "Body", "from": [4, 2, 4], - "to": [12, 10, 12], + "to": [12, 11, 12], "faces": { - "north": {"uv": [4, 3, 12, 13], "texture": "#5"}, - "east": {"uv": [4, 3, 12, 13], "rotation": 270, "texture": "#5"}, - "south": {"uv": [4, 3, 12, 13], "rotation": 180, "texture": "#5"}, - "west": {"uv": [4, 3, 12, 13], "rotation": 90, "texture": "#5"}, + "north": {"uv": [4, 3, 12, 12], "texture": "#5"}, + "east": {"uv": [4, 3, 12, 12], "texture": "#5"}, + "south": {"uv": [4, 3, 12, 12], "texture": "#5"}, + "west": {"uv": [4, 3, 12, 12], "texture": "#5"}, "up": {"uv": [3, 3, 11, 11], "rotation": 180, "texture": "#5"}, "down": {"uv": [0, 4, 8, 14], "texture": "#5"} } }, { - "from": [12, 1, 2], - "to": [14, 15, 4], - "faces": { - "north": {"uv": [1, 0, 15, 2], "rotation": 270, "texture": "#7"}, - "east": {"uv": [14, 1, 16, 15], "texture": "#7"}, - "south": {"uv": [1, 14, 15, 16], "rotation": 90, "texture": "#7"}, - "west": {"uv": [0, 1, 2, 15], "rotation": 180, "texture": "#7"}, - "up": {"uv": [14, 10, 16, 12], "texture": "#6"}, - "down": {"uv": [14, 10, 16, 12], "rotation": 270, "texture": "#6"} - } - }, - { - "from": [12, 1, 12], - "to": [14, 15, 14], - "faces": { - "north": {"uv": [1, 16, 15, 14], "rotation": 90, "texture": "#7"}, - "east": {"uv": [16, 1, 14, 15], "texture": "#7"}, - "south": {"uv": [1, 2, 15, 0], "rotation": 270, "texture": "#7"}, - "west": {"uv": [2, 1, 0, 15], "rotation": 180, "texture": "#7"}, - "up": {"uv": [14, 12, 16, 10], "texture": "#6"}, - "down": {"uv": [16, 10, 14, 12], "rotation": 270, "texture": "#6"} - } - }, - { - "from": [2, 1, 2], - "to": [4, 15, 4], - "faces": { - "north": {"uv": [1, 2, 15, 0], "rotation": 270, "texture": "#7"}, - "east": {"uv": [2, 1, 0, 15], "rotation": 180, "texture": "#7"}, - "south": {"uv": [1, 16, 15, 14], "rotation": 90, "texture": "#7"}, - "west": {"uv": [16, 1, 14, 15], "texture": "#7"}, - "up": {"uv": [16, 10, 14, 12], "texture": "#6"}, - "down": {"uv": [14, 12, 16, 10], "rotation": 270, "texture": "#6"} - } - }, - { - "from": [2, 1, 12], + "from": [2, 0, 12], "to": [4, 15, 14], "faces": { - "north": {"uv": [1, 14, 15, 16], "rotation": 90, "texture": "#7"}, - "east": {"uv": [0, 1, 2, 15], "rotation": 180, "texture": "#7"}, - "south": {"uv": [1, 0, 15, 2], "rotation": 270, "texture": "#7"}, - "west": {"uv": [14, 1, 16, 15], "texture": "#7"}, + "north": {"uv": [1, 14, 16, 16], "rotation": 90, "texture": "#7"}, + "east": {"uv": [0, 0, 2, 15], "rotation": 180, "texture": "#7"}, + "south": {"uv": [0, 0, 15, 2], "rotation": 270, "texture": "#7"}, + "west": {"uv": [14, 1, 16, 16], "texture": "#7"}, "up": {"uv": [16, 12, 14, 10], "texture": "#6"}, "down": {"uv": [16, 12, 14, 10], "rotation": 270, "texture": "#6"} } }, { - "from": [11, 0, 11], - "to": [15, 4, 15], + "from": [2, 0, 2], + "to": [4, 15, 4], "faces": { - "north": {"uv": [8, 0, 12, 4], "texture": "#9"}, - "east": {"uv": [0, 0, 4, 4], "texture": "#9"}, - "south": {"uv": [8, 0, 12, 4], "texture": "#9"}, - "west": {"uv": [1, 0, 5, 4], "texture": "#9"}, - "up": {"uv": [1, 4, 5, 8], "rotation": 90, "texture": "#8"}, - "down": {"uv": [3, 3, 7, 7], "rotation": 180, "texture": "#8"} + "north": {"uv": [0, 2, 15, 0], "rotation": 270, "texture": "#7"}, + "east": {"uv": [2, 0, 0, 15], "rotation": 180, "texture": "#7"}, + "south": {"uv": [1, 16, 16, 14], "rotation": 90, "texture": "#7"}, + "west": {"uv": [16, 1, 14, 16], "texture": "#7"}, + "up": {"uv": [16, 10, 14, 12], "texture": "#6"}, + "down": {"uv": [14, 12, 16, 10], "rotation": 270, "texture": "#6"} } }, { - "from": [11, 0, 1], - "to": [15, 4, 5], + "from": [12, 0, 12], + "to": [14, 15, 14], "faces": { - "north": {"uv": [12, 0, 8, 4], "texture": "#9"}, - "east": {"uv": [4, 0, 0, 4], "texture": "#9"}, - "south": {"uv": [12, 0, 8, 4], "texture": "#9"}, - "west": {"uv": [5, 0, 1, 4], "texture": "#9"}, - "up": {"uv": [5, 4, 1, 8], "rotation": 90, "texture": "#8"}, - "down": {"uv": [3, 7, 7, 3], "rotation": 180, "texture": "#8"} + "north": {"uv": [1, 16, 16, 14], "rotation": 90, "texture": "#7"}, + "east": {"uv": [16, 1, 14, 16], "texture": "#7"}, + "south": {"uv": [0, 2, 15, 0], "rotation": 270, "texture": "#7"}, + "west": {"uv": [2, 0, 0, 15], "rotation": 180, "texture": "#7"}, + "up": {"uv": [14, 12, 16, 10], "texture": "#6"}, + "down": {"uv": [16, 10, 14, 12], "rotation": 270, "texture": "#6"} } }, { - "from": [1, 0, 11], - "to": [5, 4, 15], + "from": [12, 0, 2], + "to": [14, 15, 4], "faces": { - "north": {"uv": [12, 0, 8, 4], "texture": "#9"}, - "east": {"uv": [5, 0, 1, 4], "texture": "#9"}, - "south": {"uv": [12, 0, 8, 4], "texture": "#9"}, - "west": {"uv": [4, 0, 0, 4], "texture": "#9"}, - "up": {"uv": [1, 8, 5, 4], "rotation": 90, "texture": "#8"}, - "down": {"uv": [7, 3, 3, 7], "rotation": 180, "texture": "#8"} + "north": {"uv": [0, 0, 15, 2], "rotation": 270, "texture": "#7"}, + "east": {"uv": [14, 1, 16, 16], "texture": "#7"}, + "south": {"uv": [1, 14, 16, 16], "rotation": 90, "texture": "#7"}, + "west": {"uv": [0, 0, 2, 15], "rotation": 180, "texture": "#7"}, + "up": {"uv": [14, 10, 16, 12], "texture": "#6"}, + "down": {"uv": [14, 10, 16, 12], "rotation": 270, "texture": "#6"} } }, { - "from": [1, 0, 1], - "to": [5, 4, 5], + "from": [3, 0.2, 3], + "to": [13, 4, 13], "faces": { - "north": {"uv": [8, 0, 12, 4], "texture": "#9"}, - "east": {"uv": [1, 0, 5, 4], "texture": "#9"}, - "south": {"uv": [8, 0, 12, 4], "texture": "#9"}, - "west": {"uv": [0, 0, 4, 4], "texture": "#9"}, - "up": {"uv": [5, 8, 1, 4], "rotation": 90, "texture": "#8"}, - "down": {"uv": [7, 7, 3, 3], "rotation": 180, "texture": "#8"} + "north": {"uv": [8, 0, 18, 4], "texture": "#9"}, + "east": {"uv": [1, 0, 11, 4], "texture": "#9"}, + "south": {"uv": [8, 0, 18, 4], "texture": "#9"}, + "west": {"uv": [0, 0, 10, 4], "texture": "#9"}, + "up": {"uv": [11, 14, 1, 4], "rotation": 90, "texture": "#8"}, + "down": {"uv": [10, 10, 0, 0], "rotation": 180, "texture": "#6"} } } ] diff --git a/src/main/resources/assets/create/models/block/creative_motor/item.json b/src/main/resources/assets/create/models/block/creative_motor/item.json index 903ee9ec5..da44299a2 100644 --- a/src/main/resources/assets/create/models/block/creative_motor/item.json +++ b/src/main/resources/assets/create/models/block/creative_motor/item.json @@ -65,14 +65,14 @@ { "name": "Body", "from": [4, 4, 2], - "to": [12, 12, 10], + "to": [12, 12, 11], "faces": { "north": {"uv": [0, 4, 8, 14], "rotation": 180, "texture": "#5"}, - "east": {"uv": [4, 3, 12, 13], "rotation": 180, "texture": "#5"}, + "east": {"uv": [4, 3, 12, 12], "rotation": 90, "texture": "#5"}, "south": {"uv": [3, 3, 11, 11], "rotation": 180, "texture": "#5"}, - "west": {"uv": [4, 3, 12, 13], "rotation": 180, "texture": "#5"}, - "up": {"uv": [4, 3, 12, 13], "rotation": 180, "texture": "#5"}, - "down": {"uv": [4, 3, 12, 13], "rotation": 180, "texture": "#5"} + "west": {"uv": [4, 3, 12, 12], "rotation": 90, "texture": "#5"}, + "up": {"uv": [4, 3, 12, 12], "rotation": 180, "texture": "#5"}, + "down": {"uv": [4, 3, 12, 12], "rotation": 180, "texture": "#5"} } }, { @@ -151,18 +151,17 @@ } } ], + "display": { + "gui": { + "rotation": [30, 45, 0], + "scale": [0.625, 0.625, 0.625] + } + }, "groups": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, { "name": "shaft", "origin": [8, 8, 8], "children": [10] } - ], - "display": { - "gui": { - "rotation": [ 30, 45, 0 ], - "translation": [ 0, 0, 0], - "scale":[ 0.625, 0.625, 0.625 ] - } - } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/encased_fan/block.json b/src/main/resources/assets/create/models/block/encased_fan/block.json index cc03182de..1dce214f0 100644 --- a/src/main/resources/assets/create/models/block/encased_fan/block.json +++ b/src/main/resources/assets/create/models/block/encased_fan/block.json @@ -13,7 +13,7 @@ "from": [0, 0, 0], "to": [16, 16, 2], "faces": { - "north": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#fan_side"}, + "north": {"uv": [0, 0, 16, 16], "texture": "#fan_side"}, "east": {"uv": [14, 0, 16, 16], "texture": "#fan_side"}, "south": {"uv": [0, 0, 16, 16], "texture": "#fan_side"}, "west": {"uv": [14, 0, 16, 16], "rotation": 180, "texture": "#fan_side"}, @@ -26,7 +26,7 @@ "from": [0, 0, 14], "to": [16, 16, 16], "faces": { - "north": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#fan_side"}, + "north": {"uv": [0, 0, 16, 16], "texture": "#fan_side"}, "east": {"uv": [0, 0, 2, 16], "texture": "#fan_side"}, "south": {"uv": [0, 0, 16, 16], "texture": "#fan_side"}, "west": {"uv": [14, 0, 16, 16], "texture": "#fan_side"}, @@ -50,7 +50,7 @@ "from": [14, 0, 2], "to": [16, 16, 14], "faces": { - "east": {"uv": [2, 0, 14, 16], "rotation": 180, "texture": "#fan_side"}, + "east": {"uv": [2, 0, 14, 16], "texture": "#fan_side"}, "west": {"uv": [14, 0, 2, 16], "texture": "#fan_side"}, "up": {"uv": [0, 2, 2, 14], "rotation": 180, "texture": "#fan_casing"}, "down": {"uv": [14, 2, 16, 14], "texture": "#fan_casing"} diff --git a/src/main/resources/assets/create/models/block/encased_fan/item.json b/src/main/resources/assets/create/models/block/encased_fan/item.json index 00f5a814e..fe80c3a0e 100644 --- a/src/main/resources/assets/create/models/block/encased_fan/item.json +++ b/src/main/resources/assets/create/models/block/encased_fan/item.json @@ -4,8 +4,8 @@ "textures": { "2": "create:block/gearbox", "fan_casing": "create:block/fan_casing", - "fan_side": "create:block/fan_side", "particle": "create:block/fan_side", + "fan_side": "create:block/fan_side", "axis_top": "create:block/axis_top", "fan_blades": "create:block/fan_blades", "axis": "create:block/axis" @@ -21,7 +21,7 @@ "south": {"uv": [0, 14, 16, 16], "texture": "#fan_casing"}, "west": {"uv": [14, 0, 16, 16], "rotation": 90, "texture": "#fan_side"}, "up": {"uv": [0, 0, 16, 16], "texture": "#fan_side"}, - "down": {"uv": [0, 0, 16, 16], "texture": "#fan_side"} + "down": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#fan_side"} } }, { @@ -34,7 +34,7 @@ "south": {"uv": [0, 0, 16, 2], "texture": "#fan_casing"}, "west": {"uv": [14, 0, 16, 16], "rotation": 270, "texture": "#fan_side"}, "up": {"uv": [0, 0, 16, 16], "texture": "#fan_side"}, - "down": {"uv": [0, 0, 16, 16], "texture": "#fan_side"} + "down": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#fan_side"} } }, { @@ -54,7 +54,7 @@ "to": [16, 14, 16], "faces": { "north": {"uv": [0, 2, 2, 14], "texture": "#fan_casing"}, - "east": {"uv": [2, 0, 14, 16], "rotation": 270, "texture": "#fan_side"}, + "east": {"uv": [2, 0, 14, 16], "rotation": 90, "texture": "#fan_side"}, "south": {"uv": [14, 2, 16, 14], "texture": "#fan_casing"}, "west": {"uv": [14, 0, 2, 16], "rotation": 270, "texture": "#fan_side"} } diff --git a/src/main/resources/assets/create/models/block/fluid_pipe/drain/down.json b/src/main/resources/assets/create/models/block/fluid_pipe/drain/down.json new file mode 100644 index 000000000..5da83c4d1 --- /dev/null +++ b/src/main/resources/assets/create/models/block/fluid_pipe/drain/down.json @@ -0,0 +1,41 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "create:block/pipe_drain", + "particle": "create:block/fluid_pipe", + "1_0": "create:block/fluid_pipe" + }, + "elements": [ + { + "from": [4.5, -3.9, 4.5], + "to": [11.5, -0.9, 11.5], + "faces": { + "north": {"uv": [0, 0, 7, 3], "texture": "#0"}, + "east": {"uv": [0, 0, 7, 3], "texture": "#0"}, + "south": {"uv": [0, 0, 7, 3], "texture": "#0"}, + "west": {"uv": [0, 0, 7, 3], "texture": "#0"}, + "up": {"uv": [0, 0, 0, 0], "texture": "#0"}, + "down": {"uv": [0, 3, 7, 10], "texture": "#0"} + } + }, + { + "from": [3.1, -1.1, 3.1], + "to": [12.9, 1, 12.9], + "faces": { + "north": {"uv": [6, 5, 11, 6], "rotation": 180, "texture": "#1_0"}, + "east": {"uv": [11, 6, 6, 5], "texture": "#1_0"}, + "south": {"uv": [6, 5, 11, 6], "rotation": 180, "texture": "#1_0"}, + "west": {"uv": [11, 6, 6, 5], "texture": "#1_0"}, + "up": {"uv": [6, 0, 11, 5], "rotation": 90, "texture": "#1_0"}, + "down": {"uv": [6, 0, 11, 5], "rotation": 90, "texture": "#1_0"} + } + } + ], + "groups": [0, + { + "name": "up", + "origin": [8, 8, 8], + "children": [1] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/fluid_pipe/drain/east.json b/src/main/resources/assets/create/models/block/fluid_pipe/drain/east.json new file mode 100644 index 000000000..70b1659c3 --- /dev/null +++ b/src/main/resources/assets/create/models/block/fluid_pipe/drain/east.json @@ -0,0 +1,41 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "create:block/pipe_drain", + "particle": "create:block/fluid_pipe", + "1_0": "create:block/fluid_pipe" + }, + "elements": [ + { + "from": [16.9, 4.5, 4.5], + "to": [19.9, 11.5, 11.5], + "faces": { + "north": {"uv": [0, 0, 7, 3], "rotation": 90, "texture": "#0"}, + "east": {"uv": [0, 3, 7, 10], "rotation": 180, "texture": "#0"}, + "south": {"uv": [0, 0, 7, 3], "rotation": 270, "texture": "#0"}, + "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, + "up": {"uv": [0, 0, 7, 3], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 0, 7, 3], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [15, 3.1, 3.1], + "to": [17.1, 12.9, 12.9], + "faces": { + "north": {"uv": [11, 6, 6, 5], "rotation": 90, "texture": "#1_0"}, + "east": {"uv": [6, 0, 11, 5], "rotation": 270, "texture": "#1_0"}, + "south": {"uv": [11, 6, 6, 5], "rotation": 270, "texture": "#1_0"}, + "west": {"uv": [6, 0, 11, 5], "rotation": 90, "texture": "#1_0"}, + "up": {"uv": [6, 5, 11, 6], "rotation": 90, "texture": "#1_0"}, + "down": {"uv": [6, 5, 11, 6], "rotation": 90, "texture": "#1_0"} + } + } + ], + "groups": [0, + { + "name": "up", + "origin": [8, 8, 8], + "children": [1] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/fluid_pipe/drain/north.json b/src/main/resources/assets/create/models/block/fluid_pipe/drain/north.json new file mode 100644 index 000000000..ebf01b1b8 --- /dev/null +++ b/src/main/resources/assets/create/models/block/fluid_pipe/drain/north.json @@ -0,0 +1,41 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "create:block/pipe_drain", + "particle": "create:block/fluid_pipe", + "1_0": "create:block/fluid_pipe" + }, + "elements": [ + { + "from": [4.5, 4.5, -3.9], + "to": [11.5, 11.5, -0.9], + "faces": { + "north": {"uv": [0, 3, 7, 10], "rotation": 180, "texture": "#0"}, + "east": {"uv": [0, 0, 7, 3], "rotation": 270, "texture": "#0"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, + "west": {"uv": [0, 0, 7, 3], "rotation": 90, "texture": "#0"}, + "up": {"uv": [0, 0, 7, 3], "rotation": 180, "texture": "#0"}, + "down": {"uv": [0, 0, 7, 3], "texture": "#0"} + } + }, + { + "from": [3.1, 3.1, -1.1], + "to": [12.9, 12.9, 1], + "faces": { + "north": {"uv": [6, 0, 11, 5], "rotation": 270, "texture": "#1_0"}, + "east": {"uv": [11, 6, 6, 5], "rotation": 270, "texture": "#1_0"}, + "south": {"uv": [6, 0, 11, 5], "rotation": 90, "texture": "#1_0"}, + "west": {"uv": [11, 6, 6, 5], "rotation": 90, "texture": "#1_0"}, + "up": {"uv": [6, 5, 11, 6], "texture": "#1_0"}, + "down": {"uv": [6, 5, 11, 6], "rotation": 180, "texture": "#1_0"} + } + } + ], + "groups": [0, + { + "name": "up", + "origin": [8, 8, 8], + "children": [1] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/fluid_pipe/drain/south.json b/src/main/resources/assets/create/models/block/fluid_pipe/drain/south.json new file mode 100644 index 000000000..df3dd6fc1 --- /dev/null +++ b/src/main/resources/assets/create/models/block/fluid_pipe/drain/south.json @@ -0,0 +1,41 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "create:block/pipe_drain", + "particle": "create:block/fluid_pipe", + "1_0": "create:block/fluid_pipe" + }, + "elements": [ + { + "from": [4.5, 4.5, 16.9], + "to": [11.5, 11.5, 19.9], + "faces": { + "north": {"uv": [0, 0, 0, 0], "rotation": 180, "texture": "#0"}, + "east": {"uv": [0, 0, 7, 3], "rotation": 90, "texture": "#0"}, + "south": {"uv": [0, 3, 7, 10], "texture": "#0"}, + "west": {"uv": [0, 0, 7, 3], "rotation": 270, "texture": "#0"}, + "up": {"uv": [0, 0, 7, 3], "texture": "#0"}, + "down": {"uv": [0, 0, 7, 3], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [3.1, 3.1, 15], + "to": [12.9, 12.9, 17.1], + "faces": { + "north": {"uv": [6, 0, 11, 5], "rotation": 270, "texture": "#1_0"}, + "east": {"uv": [11, 6, 6, 5], "rotation": 90, "texture": "#1_0"}, + "south": {"uv": [6, 0, 11, 5], "rotation": 90, "texture": "#1_0"}, + "west": {"uv": [11, 6, 6, 5], "rotation": 270, "texture": "#1_0"}, + "up": {"uv": [6, 5, 11, 6], "rotation": 180, "texture": "#1_0"}, + "down": {"uv": [6, 5, 11, 6], "texture": "#1_0"} + } + } + ], + "groups": [0, + { + "name": "up", + "origin": [8, 8, 8], + "children": [1] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/fluid_pipe/drain/up.json b/src/main/resources/assets/create/models/block/fluid_pipe/drain/up.json new file mode 100644 index 000000000..327970657 --- /dev/null +++ b/src/main/resources/assets/create/models/block/fluid_pipe/drain/up.json @@ -0,0 +1,41 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "create:block/pipe_drain", + "particle": "create:block/fluid_pipe", + "1_0": "create:block/fluid_pipe" + }, + "elements": [ + { + "from": [4.5, 16.9, 4.5], + "to": [11.5, 19.9, 11.5], + "faces": { + "north": {"uv": [0, 0, 7, 3], "rotation": 180, "texture": "#0"}, + "east": {"uv": [0, 0, 7, 3], "rotation": 180, "texture": "#0"}, + "south": {"uv": [0, 0, 7, 3], "rotation": 180, "texture": "#0"}, + "west": {"uv": [0, 0, 7, 3], "rotation": 180, "texture": "#0"}, + "up": {"uv": [0, 3, 7, 10], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 0], "texture": "#0"} + } + }, + { + "from": [3.1, 15, 3.1], + "to": [12.9, 17.1, 12.9], + "faces": { + "north": {"uv": [6, 5, 11, 6], "texture": "#1_0"}, + "east": {"uv": [11, 6, 6, 5], "rotation": 180, "texture": "#1_0"}, + "south": {"uv": [6, 5, 11, 6], "texture": "#1_0"}, + "west": {"uv": [11, 6, 6, 5], "rotation": 180, "texture": "#1_0"}, + "up": {"uv": [6, 0, 11, 5], "rotation": 90, "texture": "#1_0"}, + "down": {"uv": [6, 0, 11, 5], "rotation": 90, "texture": "#1_0"} + } + } + ], + "groups": [0, + { + "name": "up", + "origin": [8, 8, 8], + "children": [1] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/fluid_pipe/drain/west.json b/src/main/resources/assets/create/models/block/fluid_pipe/drain/west.json new file mode 100644 index 000000000..0ae3c2d7d --- /dev/null +++ b/src/main/resources/assets/create/models/block/fluid_pipe/drain/west.json @@ -0,0 +1,41 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "create:block/pipe_drain", + "particle": "create:block/fluid_pipe", + "1_0": "create:block/fluid_pipe" + }, + "elements": [ + { + "from": [-3.9, 4.5, 4.5], + "to": [-0.9, 11.5, 11.5], + "faces": { + "north": {"uv": [0, 0, 7, 3], "rotation": 270, "texture": "#0"}, + "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, + "south": {"uv": [0, 0, 7, 3], "rotation": 90, "texture": "#0"}, + "west": {"uv": [0, 3, 7, 10], "rotation": 180, "texture": "#0"}, + "up": {"uv": [0, 0, 7, 3], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 0, 7, 3], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [-1.1, 3.1, 3.1], + "to": [1, 12.9, 12.9], + "faces": { + "north": {"uv": [11, 6, 6, 5], "rotation": 270, "texture": "#1_0"}, + "east": {"uv": [6, 0, 11, 5], "rotation": 90, "texture": "#1_0"}, + "south": {"uv": [11, 6, 6, 5], "rotation": 90, "texture": "#1_0"}, + "west": {"uv": [6, 0, 11, 5], "rotation": 270, "texture": "#1_0"}, + "up": {"uv": [6, 5, 11, 6], "rotation": 270, "texture": "#1_0"}, + "down": {"uv": [6, 5, 11, 6], "rotation": 270, "texture": "#1_0"} + } + } + ], + "groups": [0, + { + "name": "up", + "origin": [8, 8, 8], + "children": [1] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/fluid_pipe/window.json b/src/main/resources/assets/create/models/block/fluid_pipe/window.json new file mode 100644 index 000000000..5cfccad79 --- /dev/null +++ b/src/main/resources/assets/create/models/block/fluid_pipe/window.json @@ -0,0 +1,58 @@ +{ + "credit": "Made with Blockbench", + "parent": "block/block", + "textures": { + "0": "create:block/glass_fluid_pipe", + "particle": "#0" + }, + "elements": [ + { + "name": "Outer", + "from": [4, 0, 4], + "to": [12, 16, 12], + "shade": false, + "faces": { + "north": {"uv": [0, 8, 16, 16], "rotation": 90, "texture": "#0"}, + "east": {"uv": [0, 8, 16, 16], "rotation": 90, "texture": "#0"}, + "south": {"uv": [0, 8, 16, 16], "rotation": 90, "texture": "#0"}, + "west": {"uv": [0, 8, 16, 16], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "Inner", + "from": [4, 0, 11.5], + "to": [12, 16, 11.5], + "shade": false, + "faces": { + "north": {"uv": [0, 8, 16, 16], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "Inner", + "from": [4, 0, 4.5], + "to": [12, 16, 4.5], + "shade": false, + "faces": { + "south": {"uv": [0, 8, 16, 16], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "Inner", + "from": [4.5, 0, 4], + "to": [4.5, 16, 12], + "shade": false, + "faces": { + "east": {"uv": [0, 8, 16, 16], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "Inner", + "from": [11.5, 0, 4], + "to": [11.5, 16, 12], + "shade": false, + "faces": { + "west": {"uv": [0, 8, 16, 16], "rotation": 90, "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/fluid_pipe/window_alt.json b/src/main/resources/assets/create/models/block/fluid_pipe/window_alt.json new file mode 100644 index 000000000..6670d228d --- /dev/null +++ b/src/main/resources/assets/create/models/block/fluid_pipe/window_alt.json @@ -0,0 +1,58 @@ +{ + "credit": "Made with Blockbench", + "parent": "block/block", + "textures": { + "0": "create:block/glass_fluid_pipe", + "particle": "#0" + }, + "elements": [ + { + "name": "Outer", + "from": [4, 0, 4], + "to": [12, 16, 12], + "shade": false, + "faces": { + "north": {"uv": [0, 0, 16, 8], "rotation": 90, "texture": "#0"}, + "east": {"uv": [0, 0, 16, 8], "rotation": 90, "texture": "#0"}, + "south": {"uv": [0, 0, 16, 8], "rotation": 90, "texture": "#0"}, + "west": {"uv": [0, 0, 16, 8], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "Inner", + "from": [4, 0, 11.5], + "to": [12, 16, 11.5], + "shade": false, + "faces": { + "north": {"uv": [0, 0, 16, 8], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "Inner", + "from": [4, 0, 4.5], + "to": [12, 16, 4.5], + "shade": false, + "faces": { + "south": {"uv": [0, 0, 16, 8], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "Inner", + "from": [4.5, 0, 4], + "to": [4.5, 16, 12], + "shade": false, + "faces": { + "east": {"uv": [0, 0, 16, 8], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "Inner", + "from": [11.5, 0, 4], + "to": [11.5, 16, 12], + "shade": false, + "faces": { + "west": {"uv": [0, 0, 16, 8], "rotation": 90, "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/mechanical_pump/block.json b/src/main/resources/assets/create/models/block/mechanical_pump/block.json index 0d3583084..859edf294 100644 --- a/src/main/resources/assets/create/models/block/mechanical_pump/block.json +++ b/src/main/resources/assets/create/models/block/mechanical_pump/block.json @@ -13,10 +13,10 @@ "to": [12, 12, 12], "rotation": {"angle": 0, "axis": "y", "origin": [8, 7, 8]}, "faces": { - "north": {"uv": [0, 8, 4, 12], "texture": "#3"}, - "east": {"uv": [0, 8, 4, 12], "texture": "#3"}, - "south": {"uv": [0, 8, 4, 12], "texture": "#3"}, - "west": {"uv": [0, 8, 4, 12], "texture": "#3"} + "north": {"uv": [0, 6, 4, 10], "texture": "#3"}, + "east": {"uv": [0, 6, 4, 10], "texture": "#3"}, + "south": {"uv": [0, 6, 4, 10], "texture": "#3"}, + "west": {"uv": [0, 6, 4, 10], "texture": "#3"} } }, { diff --git a/src/main/resources/assets/create/models/block/mechanical_pump/cog.json b/src/main/resources/assets/create/models/block/mechanical_pump/cog.json index 615d7cf83..aa1befa09 100644 --- a/src/main/resources/assets/create/models/block/mechanical_pump/cog.json +++ b/src/main/resources/assets/create/models/block/mechanical_pump/cog.json @@ -76,20 +76,6 @@ "up": {"uv": [0, 6, 6, 8.5], "rotation": 180, "texture": "#5"}, "down": {"uv": [0, 6, 6, 8.5], "texture": "#5"} } - }, - { - "name": "GearCaseOuter", - "from": [4, 4, 4.5], - "to": [12, 12, 11.5], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 6.5]}, - "faces": { - "north": {"uv": [1, 1, 5, 5], "rotation": 180, "texture": "#5"}, - "east": {"uv": [6, 4.5, 10, 8], "rotation": 270, "texture": "#5"}, - "south": {"uv": [1, 1, 5, 5], "texture": "#5"}, - "west": {"uv": [6, 4.5, 10, 8], "rotation": 90, "texture": "#5"}, - "up": {"uv": [6, 4.5, 10, 8], "rotation": 180, "texture": "#5"}, - "down": {"uv": [6, 4.5, 10, 8], "texture": "#5"} - } } ], "display": { @@ -130,7 +116,7 @@ { "name": "cogwheel", "origin": [8, 8, 8], - "children": [0, 1, 2, 3, 4, 5] + "children": [0, 1, 2, 3, 4] } ] } \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/woah.bbmodel b/src/main/resources/assets/create/models/block/woah.bbmodel new file mode 100644 index 000000000..8d892f750 --- /dev/null +++ b/src/main/resources/assets/create/models/block/woah.bbmodel @@ -0,0 +1 @@ +{"meta":{"format_version":"3.6","creation_time":1597999954,"model_format":"java_block","box_uv":false},"name":"refined_radiance_block","parent":"","ambientocclusion":true,"front_gui_light":false,"visible_box":[1,1,0],"resolution":{"width":16,"height":16},"elements":[{"name":"cube","from":[1,1,1],"to":[15,15,15],"autouv":0,"color":5,"locked":false,"shade":false,"origin":[9,9,9],"faces":{"north":{"uv":[1,1,15,15],"rotation":270,"texture":0},"east":{"uv":[1,1,15,15],"texture":0},"south":{"uv":[1,1,15,15],"rotation":90,"texture":0},"west":{"uv":[1,1,15,15],"texture":0},"up":{"uv":[1,1,15,15],"texture":0},"down":{"uv":[1,1,15,15],"rotation":180,"texture":0}},"uuid":"99c1a166-47d2-11c6-e8a4-435121561fad"},{"name":"cube_outline","from":[15.99,15.99,15.99],"to":[0.01,0.01,0.01],"autouv":0,"color":2,"locked":false,"shade":false,"origin":[9,9,9],"faces":{"north":{"uv":[15,0,16,16],"rotation":180,"texture":0},"east":{"uv":[15,0,16,16],"rotation":180,"texture":0},"south":{"uv":[15,0,16,16],"rotation":180,"texture":0},"west":{"uv":[15,0,16,16],"rotation":180,"texture":0},"up":{"uv":[0,15,16,16],"rotation":180,"texture":0},"down":{"uv":[0,0,16,1],"rotation":180,"texture":0}},"uuid":"1adda3f3-3a92-2907-8b8b-1011e6591624"},{"name":"cube","from":[-17,1,19],"to":[-3,15,33],"autouv":0,"color":5,"locked":false,"shade":false,"origin":[-9,9,27],"faces":{"north":{"uv":[1,1,15,15],"rotation":270,"texture":1},"east":{"uv":[1,1,15,15],"texture":1},"south":{"uv":[1,1,15,15],"rotation":90,"texture":1},"west":{"uv":[1,1,15,15],"texture":1},"up":{"uv":[1,1,15,15],"texture":1},"down":{"uv":[1,1,15,15],"rotation":180,"texture":1}},"uuid":"9009b855-f5d3-ad94-7c96-88bdfa6ca12b"},{"name":"cube_outline","from":[-2.01,15.99,33.99],"to":[-17.990000000000002,0.01,18.009999999999998],"autouv":0,"color":2,"locked":false,"shade":false,"origin":[-9,9,27],"faces":{"north":{"uv":[15,0,16,16],"rotation":180,"texture":1},"east":{"uv":[15,0,16,16],"rotation":180,"texture":1},"south":{"uv":[15,0,16,16],"rotation":180,"texture":1},"west":{"uv":[15,0,16,16],"rotation":180,"texture":1},"up":{"uv":[0,15,16,16],"rotation":180,"texture":1},"down":{"uv":[0,0,16,1],"rotation":180,"texture":1}},"uuid":"b64f6747-ff29-cc65-92c7-5bc82f4169b4"},{"name":"cube","from":[0,31,0],"to":[16,47,16],"autouv":0,"color":2,"locked":false,"origin":[8,39,8],"faces":{"north":{"uv":[0,0,16,16],"texture":3},"east":{"uv":[0,0,1,1],"texture":3},"south":{"uv":[0,0,1,1],"texture":3},"west":{"uv":[0,0,16,16],"texture":3},"up":{"uv":[0,0,16,16],"texture":3},"down":{"uv":[0,0,1,1],"texture":3}},"uuid":"bfaaafcf-79e9-4d59-fa83-5ca6330fb98e"},{"name":"cube","from":[-18,31,18],"to":[-2,47,34],"autouv":0,"color":2,"locked":false,"origin":[-10,39,26],"faces":{"north":{"uv":[0,0,16,16],"texture":2},"east":{"uv":[0,0,1,1]},"south":{"uv":[0,0,1,1]},"west":{"uv":[0,0,16,16],"texture":2},"up":{"uv":[0,0,16,16],"texture":2},"down":{"uv":[0,0,1,1]}},"uuid":"33b7728c-8f3d-3223-b44b-33bdd3d70655"}],"outliner":["99c1a166-47d2-11c6-e8a4-435121561fad","9009b855-f5d3-ad94-7c96-88bdfa6ca12b","1adda3f3-3a92-2907-8b8b-1011e6591624","b64f6747-ff29-cc65-92c7-5bc82f4169b4","bfaaafcf-79e9-4d59-fa83-5ca6330fb98e","33b7728c-8f3d-3223-b44b-33bdd3d70655"],"textures":[{"path":"C:\\Users\\Daniel Amberson\\Documents\\Github\\Create\\src\\main\\resources\\assets\\create\\textures\\block\\refined_radiance_block.png","name":"refined_radiance_block.png","folder":"block","namespace":"create","id":"0","particle":true,"visible":true,"mode":"bitmap","saved":true,"uuid":"7dc5cb75-65a2-b598-a956-af449fa6c671","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABOElEQVQ4T6WTsWvCQBTGX4bAcR1MLQ6FCu3gIiK6ujj6d7s4uFREQotQWxQcpDYdPIIBT76LL7kzCQh+S5J77/3yvXd3ntYnTXfIAyBcTR1EFP0530HwWPgFcgb9EWWA15dnkn6j0otKdk5stgirAXu1zpKFLwpgxD8+vxigdLiaU/utS0TCFO7Vkg4qpgcpyAbABVzmgCFaUHryPqZBf2gCLBfQJKLYiacOSgAotPVUC0j6KcAWuy44uAZwG3Yx2mDXDoAnHSex6R3PMtVl0wXkQ+T0fJj2TPDOjtJtvMwAAJwDVnoeBKlkbVxwWyiG4O5mwO9/ZIpQXJctM0y0+r3Zmq33DscfjQ92gD+iRwiJ9hwAgCsIDnqddjkACQzhtuxDhDWcgwwA2rVwgcoulb2WASpv0A2BMwut+9HTZJyiAAAAAElFTkSuQmCC"},{"path":"C:\\Users\\Daniel Amberson\\Documents\\Github\\Create\\src\\main\\resources\\assets\\create\\textures\\block\\shadow_steel_block.png","name":"shadow_steel_block.png","folder":"block","namespace":"create","id":"1","particle":false,"visible":true,"mode":"bitmap","saved":true,"uuid":"b861d327-ac6b-90c6-5cfd-1063e6c5353e","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABdUlEQVQ4T6WTXUsCURCGx7zQXKTMtZLCNSwrpAgM6S8U/dwoiC6KugihEEPKLdEVog+1AtEKc4t3ljmaHxE1N2c4e97nvDNn1qV5wp/0j3ABEIsu/wlRKF2SAmykUgy5qzwoWHDSp/LaY5Nz7JXyZcrkMtRqfTiAMX+Itje31OHsRY7z5muDV9+oRl4PUXQxwmLEWfacbNvuAOIxg+LxBDsIh6ZIIDgMsT+gU+W+yrlZsKjeqPUDnl4aZMwZfINAesWw7vMG+gHJ9SRZRYvFgNSfq+wITlDKxLjGdSMiMwtULOe/O+gGoObQtGNZ1qsbR4zb9aA+HABxb92AHJ8csBgxEIAmvr07D7G6kqDTdJpzWMc+9nb2dp0SZg3K5Qe8ghxE3Wie1Lw0v6bAgAx1IE3rFottcYhy0Oy+JmKQTNMZILlZxDJh3ZDDo/3OK+BfQK0IDIk0SoTSWGmuXKJGGYDy7TW127Zoflzd7hH+rgC/Ug059AWa99+xLR67XgAAAABJRU5ErkJggg=="},{"path":"C:\\Users\\Daniel Amberson\\Documents\\Github\\Create\\src\\main\\resources\\assets\\create\\textures\\block\\shadow_steel_casing.png","name":"shadow_steel_casing.png","folder":"block","namespace":"create","id":"2","particle":false,"visible":true,"mode":"bitmap","saved":true,"uuid":"599d0ba9-034b-83b3-308b-98a586892edc","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABTElEQVQ4T52T22qDQBCGRwgeNlo1VkJLyUVpobd9/1cpvSgJImI0jTXJVkj514yHaHrh3KysM9/8c1jt9eX9bJmCptjhWJIGQBgEZIm5YthOfRqmPspMk0zd/8oTRXFcAx6WS8p3ezocE5rNZqOBVVWpfzgtMyTPdfqAKP5UDrpukK6PZ5dSkpQnBQmDFSVp2ipI0i8VDAfbdgYQBBfFvvHx3cchAIEwKNhu08u3UffGtgkQGEA3ARzcLYUDGcKA9WbdL4GlI3tXDbLibrEIlIo8z1QP/gXAmY3rvwnAHqCJnuer+ouiaHrBEMhmVQMFDBBirgBdCACYDGeHmrL86Y8RgE30oRRcj7GevbxA6zEqBffPtPvO2lUGQAjRWyTuPhTxNxKUZTkEYKukzJoF4pXG1nWbWe+JT+6d3yqY8hrxEmHa6untPOUpc8wfFMv4KQcC4BAAAAAASUVORK5CYII="},{"path":"C:\\Users\\Daniel Amberson\\Documents\\Github\\Create\\src\\main\\resources\\assets\\create\\textures\\block\\refined_radiance_casing.png","name":"refined_radiance_casing.png","folder":"block","namespace":"create","id":"3","particle":false,"visible":true,"mode":"bitmap","saved":true,"uuid":"165988ee-cfb9-73c6-5d47-5a6e9de39d97","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABu0lEQVQ4T2Ocv2TSfwVFeQZiwedPH1GUMm7avui/r0c4w68/3xmevXzKICUuzcDGwomiCCQHAzA1v35/Y9h/cA8D2ABrGzuwfG9LD5jm5uSAa/j6/Qdc7M279wwiQoIMGcU5YLGjRw5BDFBQUGeYP30Whi84OREu+f4d4gqQGIidmJnG8ODBTYgBurrGDMvmzAcrEJGRZ2Dh4Ucx7M8XiL//fP3M8PMHxKDA6AiGy5fPMjCCAtHBwRlsAMi58qrqYIXogIWbFyz09e0rBpBXIhJiIS6AGTB78nSwApABMNtANEwjzECQ4R/ev2PwDQ9FNWBSVx/Yf6AARA44ZJeAxGFhAQ8DkAv8/P0YFk6by8AtLIbT/zDns3Nwwl1w9uxJiBdABszoncIgICgEdjKuMAD5H2TA02fPwGGA1QCYk5H9DjMQ5HeQJXfu3gVHI9gAWEJqqW6GxzNyQkKPDVg4oBggKirDsG/LNnD0qCgrY4Q8zBCQF0AApM7Vz5UBlC9QkjLIFaCkCg4waBIGsUEugqVKUCxEpSSC1YATEiwpf/36leH16ycMINfgAyA1oKQPU8/Y3l35H68OApIAUjn+WY81uz8AAAAASUVORK5CYII="}],"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],"scale":[0.625,0.625,0.625]},"fixed":{"scale":[0.5,0.5,0.5]}}} \ No newline at end of file diff --git a/src/main/resources/assets/create/textures/block/andesite_casing_short.png b/src/main/resources/assets/create/textures/block/andesite_casing_short.png index f692c2796..3bed29ac3 100644 Binary files a/src/main/resources/assets/create/textures/block/andesite_casing_short.png and b/src/main/resources/assets/create/textures/block/andesite_casing_short.png differ diff --git a/src/main/resources/assets/create/textures/block/andesite_casing_very_short.png b/src/main/resources/assets/create/textures/block/andesite_casing_very_short.png index 692ef9d9f..05c00d12b 100644 Binary files a/src/main/resources/assets/create/textures/block/andesite_casing_very_short.png and b/src/main/resources/assets/create/textures/block/andesite_casing_very_short.png differ diff --git a/src/main/resources/assets/create/textures/block/basin.png b/src/main/resources/assets/create/textures/block/basin.png index c650eea86..73cf03ed4 100644 Binary files a/src/main/resources/assets/create/textures/block/basin.png and b/src/main/resources/assets/create/textures/block/basin.png differ diff --git a/src/main/resources/assets/create/textures/block/basin_side.png b/src/main/resources/assets/create/textures/block/basin_side.png index be37152b6..5cd57bd03 100644 Binary files a/src/main/resources/assets/create/textures/block/basin_side.png and b/src/main/resources/assets/create/textures/block/basin_side.png differ diff --git a/src/main/resources/assets/create/textures/block/brass_funnel_plating.png b/src/main/resources/assets/create/textures/block/brass_funnel_plating.png index 4653ff14c..09ffc1e0d 100644 Binary files a/src/main/resources/assets/create/textures/block/brass_funnel_plating.png and b/src/main/resources/assets/create/textures/block/brass_funnel_plating.png differ diff --git a/src/main/resources/assets/create/textures/block/brass_tunnel.png b/src/main/resources/assets/create/textures/block/brass_tunnel.png index f877d926f..70e1df0a3 100644 Binary files a/src/main/resources/assets/create/textures/block/brass_tunnel.png and b/src/main/resources/assets/create/textures/block/brass_tunnel.png differ diff --git a/src/main/resources/assets/create/textures/block/chute.png b/src/main/resources/assets/create/textures/block/chute.png index a6d6bcf57..dbc6085e0 100644 Binary files a/src/main/resources/assets/create/textures/block/chute.png and b/src/main/resources/assets/create/textures/block/chute.png differ diff --git a/src/main/resources/assets/create/textures/block/chute_diagonal.png b/src/main/resources/assets/create/textures/block/chute_diagonal.png index dd9f8ff3e..91bacdde4 100644 Binary files a/src/main/resources/assets/create/textures/block/chute_diagonal.png and b/src/main/resources/assets/create/textures/block/chute_diagonal.png differ diff --git a/src/main/resources/assets/create/textures/block/depot_side.png b/src/main/resources/assets/create/textures/block/depot_side.png index eea606e2a..4527fc59e 100644 Binary files a/src/main/resources/assets/create/textures/block/depot_side.png and b/src/main/resources/assets/create/textures/block/depot_side.png differ diff --git a/src/main/resources/assets/create/textures/block/encased_pipe.png b/src/main/resources/assets/create/textures/block/encased_pipe.png new file mode 100644 index 000000000..41205f1af Binary files /dev/null and b/src/main/resources/assets/create/textures/block/encased_pipe.png differ diff --git a/src/main/resources/assets/create/textures/block/gauge.png b/src/main/resources/assets/create/textures/block/gauge.png index 035ad1172..1fb77e247 100644 Binary files a/src/main/resources/assets/create/textures/block/gauge.png and b/src/main/resources/assets/create/textures/block/gauge.png differ diff --git a/src/main/resources/assets/create/textures/block/glass_fluid_pipe.png b/src/main/resources/assets/create/textures/block/glass_fluid_pipe.png new file mode 100644 index 000000000..f5b36798d Binary files /dev/null and b/src/main/resources/assets/create/textures/block/glass_fluid_pipe.png differ diff --git a/src/main/resources/assets/create/textures/block/mixer_base_side.png b/src/main/resources/assets/create/textures/block/mixer_base_side.png index bc217affd..e635c876b 100644 Binary files a/src/main/resources/assets/create/textures/block/mixer_base_side.png and b/src/main/resources/assets/create/textures/block/mixer_base_side.png differ diff --git a/src/main/resources/assets/create/textures/block/pipe_drain.png b/src/main/resources/assets/create/textures/block/pipe_drain.png new file mode 100644 index 000000000..ce79757af Binary files /dev/null and b/src/main/resources/assets/create/textures/block/pipe_drain.png differ diff --git a/src/main/resources/assets/create/textures/block/refined_radiance_block.png b/src/main/resources/assets/create/textures/block/refined_radiance_block.png index 027da9087..0f1184481 100644 Binary files a/src/main/resources/assets/create/textures/block/refined_radiance_block.png and b/src/main/resources/assets/create/textures/block/refined_radiance_block.png differ diff --git a/src/main/resources/assets/create/textures/block/refined_radiance_casing.png b/src/main/resources/assets/create/textures/block/refined_radiance_casing.png index c5849bb25..2b4ec02d5 100644 Binary files a/src/main/resources/assets/create/textures/block/refined_radiance_casing.png and b/src/main/resources/assets/create/textures/block/refined_radiance_casing.png differ diff --git a/src/main/resources/assets/create/textures/block/shadow_steel_casing.png b/src/main/resources/assets/create/textures/block/shadow_steel_casing.png index c9afb30bb..56c41846b 100644 Binary files a/src/main/resources/assets/create/textures/block/shadow_steel_casing.png and b/src/main/resources/assets/create/textures/block/shadow_steel_casing.png differ diff --git a/src/main/resources/assets/create/textures/special/cutout_checkerboard.png b/src/main/resources/assets/create/textures/special/cutout_checkerboard.png new file mode 100644 index 000000000..a8e187662 Binary files /dev/null and b/src/main/resources/assets/create/textures/special/cutout_checkerboard.png differ diff --git a/src/main/resources/data/create/recipes/crafting_shaped/cake.json b/src/main/resources/data/create/recipes/crafting_shaped/cake.json deleted file mode 100644 index 5b29e01f3..000000000 --- a/src/main/resources/data/create/recipes/crafting_shaped/cake.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "type": "crafting_shaped", - "pattern": [ - " M ", - "SES", - " D " - ], - "key": { - "M": { - "item": "minecraft:milk_bucket" - }, - "S": { - "item": "minecraft:sugar" - }, - "E": { - "item": "minecraft:egg" - }, - "D": { - "item": "create:dough" - } - }, - "result": { - "item": "minecraft:cake", - "count": 1 - } -} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shaped/materials/brass_ingot.json b/src/main/resources/data/create/recipes/crafting_shaped/materials/brass_ingot.json deleted file mode 100644 index 7b44e107f..000000000 --- a/src/main/resources/data/create/recipes/crafting_shaped/materials/brass_ingot.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "###", - "###", - "###" - ], - "key": { - "#": { - "tag": "forge:nuggets/brass" - } - }, - "result": { - "item": "create:brass_ingot" - } -} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shaped/materials/copper_ingot.json b/src/main/resources/data/create/recipes/crafting_shaped/materials/copper_ingot.json deleted file mode 100644 index 77b6a3625..000000000 --- a/src/main/resources/data/create/recipes/crafting_shaped/materials/copper_ingot.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "###", - "###", - "###" - ], - "key": { - "#": { - "tag": "forge:nuggets/copper" - } - }, - "result": { - "item": "create:copper_ingot" - } -} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shaped/materials/zinc_ingot.json b/src/main/resources/data/create/recipes/crafting_shaped/materials/zinc_ingot.json deleted file mode 100644 index e62729509..000000000 --- a/src/main/resources/data/create/recipes/crafting_shaped/materials/zinc_ingot.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "###", - "###", - "###" - ], - "key": { - "#": { - "tag": "forge:nuggets/zinc" - } - }, - "result": { - "item": "create:zinc_ingot" - } -} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shaped/schematics/schematic_table.json b/src/main/resources/data/create/recipes/crafting_shaped/schematics/schematic_table.json deleted file mode 100644 index b239d0cee..000000000 --- a/src/main/resources/data/create/recipes/crafting_shaped/schematics/schematic_table.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "type": "crafting_shaped", - "pattern": [ - "WWW", - " S ", - " S " - ], - "key": { - "W": { - "tag": "minecraft:wooden_slabs" - }, - "S": { - "item": "minecraft:smooth_stone" - } - }, - "result": { - "item": "create:schematic_table", - "count": 1 - } -} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shaped/schematics/schematicannon.json b/src/main/resources/data/create/recipes/crafting_shaped/schematics/schematicannon.json deleted file mode 100644 index bb2a9b902..000000000 --- a/src/main/resources/data/create/recipes/crafting_shaped/schematics/schematicannon.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "type": "crafting_shaped", - "pattern": [ - " C ", - "LDL", - "SIS" - ], - "key": { - "I": { - "item": "minecraft:iron_block" - }, - "D": { - "item": "minecraft:dispenser" - }, - "L": { - "tag": "minecraft:logs" - }, - "S": { - "item": "minecraft:smooth_stone_slab" - }, - "C": { - "item": "minecraft:cauldron" - } - }, - "result": { - "item": "create:schematicannon", - "count": 1 - } -} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shapeless/blueprint_and_quill.json b/src/main/resources/data/create/recipes/crafting_shapeless/blueprint_and_quill.json deleted file mode 100644 index f453d23d6..000000000 --- a/src/main/resources/data/create/recipes/crafting_shapeless/blueprint_and_quill.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "crafting_shapeless", - "ingredients": [ - { - "item": "create:empty_schematic" - }, - { - "item": "minecraft:feather" - } - ], - "result": { - "item": "create:schematic_and_quill", - "count": 1 - } -} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shapeless/brass_ingot.json b/src/main/resources/data/create/recipes/crafting_shapeless/brass_ingot.json deleted file mode 100644 index 98071c6e8..000000000 --- a/src/main/resources/data/create/recipes/crafting_shapeless/brass_ingot.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "create:brass_block" - } - ], - "result": { - "item": "create:brass_ingot", - "count": 9 - } -} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shapeless/brass_nugget.json b/src/main/resources/data/create/recipes/crafting_shapeless/brass_nugget.json deleted file mode 100644 index 861ea0291..000000000 --- a/src/main/resources/data/create/recipes/crafting_shapeless/brass_nugget.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "tag": "forge:ingots/brass" - } - ], - "result": { - "item": "create:brass_nugget", - "count": 9 - } -} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shapeless/copper_ingot.json b/src/main/resources/data/create/recipes/crafting_shapeless/copper_ingot.json deleted file mode 100644 index 6f983e09e..000000000 --- a/src/main/resources/data/create/recipes/crafting_shapeless/copper_ingot.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "create:copper_block" - } - ], - "result": { - "item": "create:copper_ingot", - "count": 9 - } -} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shapeless/copper_nugget.json b/src/main/resources/data/create/recipes/crafting_shapeless/copper_nugget.json deleted file mode 100644 index b7fbc41dc..000000000 --- a/src/main/resources/data/create/recipes/crafting_shapeless/copper_nugget.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "tag": "forge:ingots/copper" - } - ], - "result": { - "item": "create:copper_nugget", - "count": 9 - } -} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shapeless/empty_blueprint.json b/src/main/resources/data/create/recipes/crafting_shapeless/empty_blueprint.json deleted file mode 100644 index a6df3a16a..000000000 --- a/src/main/resources/data/create/recipes/crafting_shapeless/empty_blueprint.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "crafting_shapeless", - "ingredients": [ - { - "item": "minecraft:paper" - }, - { - "item": "minecraft:light_blue_dye" - } - ], - "result": { - "item": "create:empty_schematic", - "count": 1 - } -} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shapeless/extractor.json b/src/main/resources/data/create/recipes/crafting_shapeless/extractor.json deleted file mode 100644 index bfc99fe56..000000000 --- a/src/main/resources/data/create/recipes/crafting_shapeless/extractor.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "create:linked_extractor" - } - ], - "result": { - "item": "create:extractor", - "count": 1 - } -} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shapeless/rose_quartz.json b/src/main/resources/data/create/recipes/crafting_shapeless/rose_quartz.json deleted file mode 100644 index ca8c4b2d7..000000000 --- a/src/main/resources/data/create/recipes/crafting_shapeless/rose_quartz.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "type": "crafting_shapeless", - "ingredients": [ - { - "tag": "forge:gems/quartz" - }, - { - "tag": "forge:dusts/redstone" - }, - { - "tag": "forge:dusts/redstone" - }, - { - "tag": "forge:dusts/redstone" - }, - { - "tag": "forge:dusts/redstone" - }, - { - "tag": "forge:dusts/redstone" - }, - { - "tag": "forge:dusts/redstone" - }, - { - "tag": "forge:dusts/redstone" - }, - { - "tag": "forge:dusts/redstone" - } - ], - "result": { - "item": "create:rose_quartz", - "count": 1 - } -} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shapeless/slime_ball.json b/src/main/resources/data/create/recipes/crafting_shapeless/slime_ball.json deleted file mode 100644 index c1e999105..000000000 --- a/src/main/resources/data/create/recipes/crafting_shapeless/slime_ball.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "crafting_shapeless", - "ingredients": [ - { - "tag": "forge:dyes/lime" - }, - { - "item": "create:dough" - } - ], - "result": { - "item": "minecraft:slime_ball", - "count": 1 - } -} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shapeless/zinc_ingot.json b/src/main/resources/data/create/recipes/crafting_shapeless/zinc_ingot.json deleted file mode 100644 index b894c4975..000000000 --- a/src/main/resources/data/create/recipes/crafting_shapeless/zinc_ingot.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "create:zinc_block" - } - ], - "result": { - "item": "create:zinc_ingot", - "count": 9 - } -} \ No newline at end of file diff --git a/src/main/resources/data/create/recipes/crafting_shapeless/zinc_nugget.json b/src/main/resources/data/create/recipes/crafting_shapeless/zinc_nugget.json deleted file mode 100644 index 89feb4d05..000000000 --- a/src/main/resources/data/create/recipes/crafting_shapeless/zinc_nugget.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "tag": "forge:ingots/zinc" - } - ], - "result": { - "item": "create:zinc_nugget", - "count": 9 - } -} \ No newline at end of file