diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index f37358666..c62faf7b1 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -14,7 +14,7 @@ a579c40c43dc2174afb66f42d00d0c4a0efaaeee assets\create\blockstates\andesite_bric 97adf53a7cb99d7652fb39adc957e9e34cbaca47 assets\create\blockstates\andesite_cobblestone_slab.json 96b5284693da168ab8e0809d86515b5f1a7e763f assets\create\blockstates\andesite_cobblestone_stairs.json 82bd82270aff7d51e9239680ef4dd7b5c899ceb0 assets\create\blockstates\andesite_cobblestone_wall.json -9210df936a886dc4727deec204f06359dd1f14e9 assets\create\blockstates\andesite_pillar.json +398922758a6219544e5b85c91c9cf8a543b437e5 assets\create\blockstates\andesite_pillar.json f9fa6aa530eb0891a74eadfbebc663172a57147a assets\create\blockstates\basin.json 96a4fae5883eda130f8ec1a57d34534f6d0793c4 assets\create\blockstates\belt.json 40d10934934ea142d71fc6ce598b1455c3ad47b4 assets\create\blockstates\belt_observer.json @@ -31,15 +31,15 @@ b8dd6e505943e06706d0718ece620ab3cf943650 assets\create\blockstates\brass_casing. cbcdab42d01f8085db9e5f8db884f8adf7f17625 assets\create\blockstates\chiseled_scoria.json 291952556c52fba2af5bbd793c71af81abd27e71 assets\create\blockstates\chiseled_weathered_limestone.json 4947c261310445fa55b92038326ac82967d192dd assets\create\blockstates\clockwork_bearing.json -86101bf2f0a5cec159c8b0e4c45ff0a73759c8b6 assets\create\blockstates\clutch.json -10e6e789e00253da08db14e885a2cd24b7306047 assets\create\blockstates\cogwheel.json +1f33834c685e3243882acfe20183fe64dfa872be assets\create\blockstates\clutch.json +e5e3757e99c139d67b2a70288466d8a74d818841 assets\create\blockstates\cogwheel.json f8eff64c75fc599e9a44a003f54ae9931cd8ce7c assets\create\blockstates\copper_block.json cabf6b8c59eb0e3d56a0a5a856ca058bb3200882 assets\create\blockstates\copper_casing.json 3355a852cdc717e257ca19b3db836068964733e3 assets\create\blockstates\copper_ore.json dc76bca1fdd41c8e6ada27fd59a2b73d7adc9596 assets\create\blockstates\copper_shingles.json 3df0d5d5170a2f6cbab0f8a9bc8f2d64229589af assets\create\blockstates\creative_crate.json f0031f5e970b3d5695472ed384950b8631b015ed assets\create\blockstates\creative_motor.json -46af6c7d1e9041e44f5ea495b0b61dcf662b9b70 assets\create\blockstates\crushing_wheel.json +fe2f78b94c20944399101e7369e2d43324297fb6 assets\create\blockstates\crushing_wheel.json a1dd6cb3daa97ea871290ef7b178d28b564ee2a2 assets\create\blockstates\crushing_wheel_controller.json b1126c191877cff86b4e2de83e1fcbd151451cb7 assets\create\blockstates\cuckoo_clock.json 1726b1b9e04a0634e7e1fdcf1cf4cc898efc5c2f assets\create\blockstates\dark_oak_window.json @@ -53,7 +53,7 @@ bfab7d9b2e01183d47a828f2827125771efa97fc assets\create\blockstates\dark_scoria_b 1ca115df6d2b5a63a1c505bc94d62543f1c0e26a assets\create\blockstates\dark_scoria_cobblestone_slab.json f86eea3f7df0988fffbe90e29b74141a7203cd15 assets\create\blockstates\dark_scoria_cobblestone_stairs.json f1020a33fcb1a362b6c55b5aa8ce093e47ebde09 assets\create\blockstates\dark_scoria_cobblestone_wall.json -1cbba7ea7b2456b617a8b6e71059beb037462a00 assets\create\blockstates\dark_scoria_pillar.json +902778a0f16b7ad009ee7b123bb583eaea32467a assets\create\blockstates\dark_scoria_pillar.json ac85f55d82d96fc15750e6b954297cfd1e00d04d assets\create\blockstates\deployer.json c890ec9b3778aebb16c6b2eb2ca79bfbe7bf7435 assets\create\blockstates\diorite_bricks.json 894d5ca00c3765553deaac44b83257983acf502d assets\create\blockstates\diorite_bricks_slab.json @@ -63,7 +63,7 @@ e42f2ebe5a2fdaeed62b9bc289252664a1e8705b assets\create\blockstates\diorite_brick a886ed9f02e54d3cf0bc55710c61f52737953ede assets\create\blockstates\diorite_cobblestone_slab.json 328e6ffb0b0124f497b2e227c814fa2bcccfeb0e assets\create\blockstates\diorite_cobblestone_stairs.json 110cddbea434aa650eac919908880a0296b38a2f assets\create\blockstates\diorite_cobblestone_wall.json -51b44abc3d7e3dfe71423230b052c3b9d1dee93d assets\create\blockstates\diorite_pillar.json +bd24921c0c66deaabbdbf557b7ff9a507402c1e5 assets\create\blockstates\diorite_pillar.json 610435897262bc9a1d98d85ce470a5030411a1d7 assets\create\blockstates\dolomite.json 710f354ec7b11b545bac9c5cb6f181229aa84be9 assets\create\blockstates\dolomite_bricks.json c681864890ec8c8c9f5ab275957979337539f782 assets\create\blockstates\dolomite_bricks_slab.json @@ -73,11 +73,11 @@ a2b7259dacf7b582e3b819e12015b5e18a1768e5 assets\create\blockstates\dolomite_cobb 5cf01ea02b50229fce2296206b9f0ce1c1b2c9f6 assets\create\blockstates\dolomite_cobblestone_slab.json e7c1db7226df5858f1884f0cf328a733fec22c3d assets\create\blockstates\dolomite_cobblestone_stairs.json f63a5816d4bfe643aa098d03c3b54462dd06fe19 assets\create\blockstates\dolomite_cobblestone_wall.json -6d7f0c92ee978366d2b019e35cf2fc6a2e4de37d assets\create\blockstates\dolomite_pillar.json +f179202e59e449157f89efc37229b03bbfd391d7 assets\create\blockstates\dolomite_pillar.json 5fca916e329ccf449f6e60eb5ac7dd7efd250a23 assets\create\blockstates\drill.json 7b1c40891b07c8f3238537625d9e25c8627e7333 assets\create\blockstates\encased_belt.json 7b2b836649e729feafa60972bf95e3afb2143131 assets\create\blockstates\encased_fan.json -373ac3c29b553322291599e93eac12000c4a87f8 assets\create\blockstates\encased_shaft.json +db1777f0eff1eb6987b569aee513656ae889ae75 assets\create\blockstates\encased_shaft.json 1442ff1a0e404f99263ba99d734da1dfed03d4e3 assets\create\blockstates\extractor.json a774e815376a67e2a2de44e39af0a1a0b4406932 assets\create\blockstates\fancy_andesite_bricks.json 180be26a75834cf9cdb881f969f77906e91cc36a assets\create\blockstates\fancy_andesite_bricks_slab.json @@ -129,9 +129,9 @@ afff479c0e5284771afa9e7ce513595fe65860ee assets\create\blockstates\gabbro_cobble 85151aa7583e4752424b2efc1b35d8c9cceb66a7 assets\create\blockstates\gabbro_cobblestone_slab.json a1f31a194129cfb65e335b3b96490f9275f9c564 assets\create\blockstates\gabbro_cobblestone_stairs.json a64d8d0924c0b5b192f355343dd9b3a440875f6a assets\create\blockstates\gabbro_cobblestone_wall.json -89faeaf1847c67a3200a31a9d9a6a68d551a807b assets\create\blockstates\gabbro_pillar.json -727cc5f4176cc02636d73b21b9490b632d77de8e assets\create\blockstates\gearbox.json -738198cf5ddd090003b5e157cc449fd001c4673d assets\create\blockstates\gearshift.json +a6b44e8a1c4ce0c7442b2384b41ad36dd133f19b assets\create\blockstates\gabbro_pillar.json +9c48e311be8b959bfb98e16ffaa358210ac8b9dd assets\create\blockstates\gearbox.json +f34814b17cde3231a1dfb271f3dabf8d6de4fbf6 assets\create\blockstates\gearshift.json 87661d61e1645ef5ad4ea34f1c0fa31f139ea431 assets\create\blockstates\granite_bricks.json d7f4cf7be7e9a3895840d9288245c52cbe25f0bd assets\create\blockstates\granite_bricks_slab.json ec51efc72eb6b16c5f99399b4cb6284665d5be99 assets\create\blockstates\granite_bricks_stairs.json @@ -140,14 +140,14 @@ ec51efc72eb6b16c5f99399b4cb6284665d5be99 assets\create\blockstates\granite_brick a4b0337149cb0617cc60061477c7178d37dbb831 assets\create\blockstates\granite_cobblestone_slab.json d97fdea02187e63f6b63913357c79a18660d676d assets\create\blockstates\granite_cobblestone_stairs.json 9ce66b5a61c3aad398756d26e4efee2b9e12a275 assets\create\blockstates\granite_cobblestone_wall.json -b51450d748285d3b13951a46deef940da7ae18ad assets\create\blockstates\granite_pillar.json +f8659e81cd2a623475a6a9aca59149e82de56b1c assets\create\blockstates\granite_pillar.json 6ab675fa06317e6d07c0c1a453e7bb43e3f46b3b assets\create\blockstates\hand_crank.json d7aad9c1ec992c42576490f633c9a3317983945c assets\create\blockstates\harvester.json be3bef7e091d8b50bfc1c6b7275946d1f636aefd assets\create\blockstates\horizontal_framed_glass.json 18d9fdaa1352a7e2ec91135e46dae5c02ccd8f8f assets\create\blockstates\horizontal_framed_glass_pane.json 5d851c90d23de5087ce546d4bbe509e112b84c49 assets\create\blockstates\jungle_window.json b15bea757ef981e0ca60f740ca234ee2014eb7b7 assets\create\blockstates\jungle_window_pane.json -c85d9caf2b34cd8c74ca9beb1d907bcfedbacd06 assets\create\blockstates\large_cogwheel.json +f651091db216b009b3379b2f48d56d03481c8675 assets\create\blockstates\large_cogwheel.json a38184e035c2ebca7471e1714494fea213af259e assets\create\blockstates\layered_andesite.json 0fef29f4bfe8e1258427252ef0ff1a414c194969 assets\create\blockstates\layered_dark_scoria.json 924a0291410406c86ded448f95c97ac3b9d2bd2e assets\create\blockstates\layered_diorite.json @@ -167,7 +167,7 @@ e7c7b952137c4cb615988ea59b9f14303c9a4dfe assets\create\blockstates\limestone_bri 19b6a403a126196144d13eafb81e172b87061019 assets\create\blockstates\limestone_cobblestone_slab.json 43532aec1893f7d2f37798d5dbb11ecde0a3bfab assets\create\blockstates\limestone_cobblestone_stairs.json 17c5a6c1dd094c9201ed90fdcebde620a8a39900 assets\create\blockstates\limestone_cobblestone_wall.json -48e4d5bce99d9aa2f629c3413f59ce1469da7e07 assets\create\blockstates\limestone_pillar.json +b7506b862d13b3f915c60d38bb7a20afc935f70a assets\create\blockstates\limestone_pillar.json c793ab3aa6cf09d8d6d4136757629689f0365771 assets\create\blockstates\linked_extractor.json c5422866667331f1d5cf6753c0889747ee02762b assets\create\blockstates\linked_transposer.json ddcf4bb281e046fbb1026b8f46a2cf12448598df assets\create\blockstates\mechanical_bearing.json @@ -288,9 +288,9 @@ a5befc14551f043675e985027609aeb7e6bacc0d assets\create\blockstates\scoria.json be96a5541f211a6929fa04ec3535cb62ce7d4a2d assets\create\blockstates\scoria_cobblestone_slab.json 41d1fbbdfb038e474254bee5284561342fea0fc9 assets\create\blockstates\scoria_cobblestone_stairs.json b6e50f46a02f833f2f2bafa8585a909b6da5e229 assets\create\blockstates\scoria_cobblestone_wall.json -b3f0bf24585f495a7936bcaf5ecd36420378563a assets\create\blockstates\scoria_pillar.json +46641fdbc6bdc05829153bc28efb90cae26a51f8 assets\create\blockstates\scoria_pillar.json 81931eb1027dfb42ba4b2186185a4c0a36e0dbe4 assets\create\blockstates\sequenced_gearshift.json -1c77f8a4618ccd25e77fd6d2b9faafa3a9320ce7 assets\create\blockstates\shaft.json +79ae6d86a829b9ce82fce68a6377d3810fcfcb10 assets\create\blockstates\shaft.json e815bfd854c2653f10828bb11950f7fb991d7efc assets\create\blockstates\speedometer.json d62b7908119fa4f51715a186d0882b388bb25cab assets\create\blockstates\spruce_window.json 8d7dfa60630a8b4bae4e8eca5c66e1cfa34dda1f assets\create\blockstates\spruce_window_pane.json @@ -299,8 +299,8 @@ f385988cb6fa9c48b5d59a6942ec50ed2b60c8bf assets\create\blockstates\stockpile_swi e815bfd854c2653f10828bb11950f7fb991d7efc assets\create\blockstates\stressometer.json 8b0c2c7ac72529565b3339aa8df7565858100afa assets\create\blockstates\tiled_glass.json a2454400b1cf9889f70aebdc89c52a1be25f543c assets\create\blockstates\tiled_glass_pane.json -eb3bb63c9ca4ac2dda80a4afbcf5c2f5dd4950da assets\create\blockstates\translation_chassis.json -53725e7de23cc0bb49b12705441c4b12e5d72dfb assets\create\blockstates\translation_chassis_secondary.json +5b56f9ab24474105d4944413056bf4989454e0f8 assets\create\blockstates\translation_chassis.json +67abb31b7675196f4e94889582b5a213f7ffa960 assets\create\blockstates\translation_chassis_secondary.json e122bf687d991dd2d7a05670039da7937f96ca05 assets\create\blockstates\transposer.json a8094531617e27a545c4815ab2062bf0ffca3633 assets\create\blockstates\turntable.json d45450255fd7a64cfd2bd8856fd4cff01a49cc8d assets\create\blockstates\vertical_extractor.json @@ -320,11 +320,11 @@ f02e0d7738c3c3622d9051db7deca7a9de274868 assets\create\blockstates\weathered_lim fd7a9c7095372485081436c91489cadb2b0c514e assets\create\blockstates\weathered_limestone_cobblestone_slab.json 47f8c91ff4c3f5cad782ab469a1fe5f4909dc7f1 assets\create\blockstates\weathered_limestone_cobblestone_stairs.json c60c3115fd6eeaa3a696428a87a74d184ab7d62d assets\create\blockstates\weathered_limestone_cobblestone_wall.json -7e2476ffff93d0eedee5314e5692fcbf5692bffc assets\create\blockstates\weathered_limestone_pillar.json +c77b46d8b459e5c7cc495393546f3fcca8a1fa1d assets\create\blockstates\weathered_limestone_pillar.json 7f39521b211441f5c3e06d60c5978cebe16cacfb assets\create\blockstates\zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets\create\blockstates\zinc_ore.json efa942851f247891194d2c6ecdd8724a23b05aa0 assets\create\lang\en_ud.json -adb6af4aa68bac360242e78b9f883d94059b1df8 assets\create\lang\en_us.json +fe4c49a84016a3861a86e116df2c7603d6d4b91f assets\create\lang\en_us.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 @@ -1329,7 +1329,7 @@ a99446c05e1896f3a280e17b47ec4d4b0e81987d data\create\loot_tables\blocks\drill.js 503a93787537b46f462d32b0382c3396f42bb1f6 data\create\loot_tables\blocks\encased_belt.json 9055d82b983b673e1638d17b712b9fcd1f5a52e6 data\create\loot_tables\blocks\encased_fan.json b3849bece65e13128fdeb033b156cf6615bc72f8 data\create\loot_tables\blocks\encased_shaft.json -205f5899101262f31f5c1a88bb7d954918d08d04 data\create\loot_tables\blocks\extractor.json +5a47c1535c866184b4ffca65763f5676f319e0aa data\create\loot_tables\blocks\extractor.json ddfc4764a6039d771e03af815ac4493da80d2e6b data\create\loot_tables\blocks\fancy_andesite_bricks.json 31f2e6932505c68b28e92221a37144f69161c376 data\create\loot_tables\blocks\fancy_andesite_bricks_slab.json 413c8bb80954679796cd9d18f808c28a7bdbe681 data\create\loot_tables\blocks\fancy_andesite_bricks_stairs.json @@ -1369,7 +1369,7 @@ e4d0fe35d3441a5815bd4e1357329b284e63ecd8 data\create\loot_tables\blocks\fancy_we f37526c092c645045c22674dea6c7b1ec503c9c3 data\create\loot_tables\blocks\flywheel.json 8fbd865f350c615031ec3f56eb98b51ce3008de3 data\create\loot_tables\blocks\framed_glass.json 44c8bc7271fa367ff052bef242e1ae26fb435175 data\create\loot_tables\blocks\framed_glass_pane.json -ed895ef7dcb97ad9b00d80a4fa9c331229dd532e data\create\loot_tables\blocks\funnel.json +205f5899101262f31f5c1a88bb7d954918d08d04 data\create\loot_tables\blocks\funnel.json 4063880eda871fe63a4eb549a19daecabce849e5 data\create\loot_tables\blocks\furnace_engine.json 1070cba1c0f46cf7ebe31089f35333f5eadda6e4 data\create\loot_tables\blocks\gabbro.json 0356e003d8890d31b89d0ad98e32aae892da71f9 data\create\loot_tables\blocks\gabbro_bricks.json @@ -1419,8 +1419,8 @@ cb315814960850b5080598b89ee94c833b5048f7 data\create\loot_tables\blocks\limeston 8db1e3f0dac48b91a4839206a7d5a88cef415fdc data\create\loot_tables\blocks\limestone_cobblestone_stairs.json 92fb16606f289ad33860270d098fad2522b24e09 data\create\loot_tables\blocks\limestone_cobblestone_wall.json 371115e5ceb08c07a9ab2371509960c31e0baa8a data\create\loot_tables\blocks\limestone_pillar.json -205f5899101262f31f5c1a88bb7d954918d08d04 data\create\loot_tables\blocks\linked_extractor.json -205f5899101262f31f5c1a88bb7d954918d08d04 data\create\loot_tables\blocks\linked_transposer.json +dac789cf53b00eed34308848b5e267b7ccec090c data\create\loot_tables\blocks\linked_extractor.json +7af5a13c9e10903b11732fbc01ae3299328216f0 data\create\loot_tables\blocks\linked_transposer.json 90ddf7b5c3b61758a4ad12a1e6ef16fe6ebf7794 data\create\loot_tables\blocks\mechanical_bearing.json e93872a90e4f4642a003539e7db28fdacfdcd114 data\create\loot_tables\blocks\mechanical_crafter.json b12efeeef5682966016ce6ea2d171eecd33d9667 data\create\loot_tables\blocks\mechanical_mixer.json @@ -1552,7 +1552,7 @@ ec2889e712702644092197a4b41a682fb953817d data\create\loot_tables\blocks\stockpil 2082f3fb39185cb65555ab93178081a2f53f6046 data\create\loot_tables\blocks\tiled_glass_pane.json d95e09420ef7580779c71888d043aa5b4c56c725 data\create\loot_tables\blocks\translation_chassis.json 7c70f942b2ffb58a3fb894e57ce4e445b9007be2 data\create\loot_tables\blocks\translation_chassis_secondary.json -205f5899101262f31f5c1a88bb7d954918d08d04 data\create\loot_tables\blocks\transposer.json +b201436ae6d2ad5a7d47dca0ee8c7016b4c28fa5 data\create\loot_tables\blocks\transposer.json 7b66ad2c48449bafd0cdbd086ac41218cb73a814 data\create\loot_tables\blocks\turntable.json eb3086010565ff1e83e30aa3712f82819bcc0e99 data\create\loot_tables\blocks\vertical_framed_glass.json 15019b1b2b77e6be8a0f4ccd20f35ebb4a82a090 data\create\loot_tables\blocks\vertical_framed_glass_pane.json diff --git a/src/generated/resources/assets/create/blockstates/andesite_pillar.json b/src/generated/resources/assets/create/blockstates/andesite_pillar.json index c6d8f75e5..a66fb4522 100644 --- a/src/generated/resources/assets/create/blockstates/andesite_pillar.json +++ b/src/generated/resources/assets/create/blockstates/andesite_pillar.json @@ -10,7 +10,8 @@ }, "axis=z": { "model": "create:block/andesite_pillar", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/clutch.json b/src/generated/resources/assets/create/blockstates/clutch.json index 75d0ed556..d07be4675 100644 --- a/src/generated/resources/assets/create/blockstates/clutch.json +++ b/src/generated/resources/assets/create/blockstates/clutch.json @@ -10,7 +10,8 @@ }, "axis=z,powered=false": { "model": "create:block/clutch/block", - "x": 90 + "x": 90, + "y": 180 }, "axis=x,powered=true": { "model": "create:block/clutch/block_powered", @@ -22,7 +23,8 @@ }, "axis=z,powered=true": { "model": "create:block/clutch/block_powered", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/cogwheel.json b/src/generated/resources/assets/create/blockstates/cogwheel.json index ff5735b7d..213f20515 100644 --- a/src/generated/resources/assets/create/blockstates/cogwheel.json +++ b/src/generated/resources/assets/create/blockstates/cogwheel.json @@ -10,7 +10,8 @@ }, "axis=z": { "model": "create:block/cogwheel", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/crushing_wheel.json b/src/generated/resources/assets/create/blockstates/crushing_wheel.json index 59167f20b..b0a631e3a 100644 --- a/src/generated/resources/assets/create/blockstates/crushing_wheel.json +++ b/src/generated/resources/assets/create/blockstates/crushing_wheel.json @@ -10,7 +10,8 @@ }, "axis=z": { "model": "create:block/crushing_wheel", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/dark_scoria_pillar.json b/src/generated/resources/assets/create/blockstates/dark_scoria_pillar.json index b62bedc23..00c3b9a06 100644 --- a/src/generated/resources/assets/create/blockstates/dark_scoria_pillar.json +++ b/src/generated/resources/assets/create/blockstates/dark_scoria_pillar.json @@ -10,7 +10,8 @@ }, "axis=z": { "model": "create:block/dark_scoria_pillar", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/diorite_pillar.json b/src/generated/resources/assets/create/blockstates/diorite_pillar.json index f16fe557b..84214a905 100644 --- a/src/generated/resources/assets/create/blockstates/diorite_pillar.json +++ b/src/generated/resources/assets/create/blockstates/diorite_pillar.json @@ -10,7 +10,8 @@ }, "axis=z": { "model": "create:block/diorite_pillar", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/dolomite_pillar.json b/src/generated/resources/assets/create/blockstates/dolomite_pillar.json index add7decdb..650b05d53 100644 --- a/src/generated/resources/assets/create/blockstates/dolomite_pillar.json +++ b/src/generated/resources/assets/create/blockstates/dolomite_pillar.json @@ -10,7 +10,8 @@ }, "axis=z": { "model": "create:block/dolomite_pillar", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/encased_shaft.json b/src/generated/resources/assets/create/blockstates/encased_shaft.json index 36ed2c8ee..ae5973592 100644 --- a/src/generated/resources/assets/create/blockstates/encased_shaft.json +++ b/src/generated/resources/assets/create/blockstates/encased_shaft.json @@ -10,7 +10,8 @@ }, "axis=z": { "model": "create:block/encased_shaft/block", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/gabbro_pillar.json b/src/generated/resources/assets/create/blockstates/gabbro_pillar.json index 296dfa822..5d40feab8 100644 --- a/src/generated/resources/assets/create/blockstates/gabbro_pillar.json +++ b/src/generated/resources/assets/create/blockstates/gabbro_pillar.json @@ -10,7 +10,8 @@ }, "axis=z": { "model": "create:block/gabbro_pillar", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/gearbox.json b/src/generated/resources/assets/create/blockstates/gearbox.json index 9bb9f7d2b..74cffdb7d 100644 --- a/src/generated/resources/assets/create/blockstates/gearbox.json +++ b/src/generated/resources/assets/create/blockstates/gearbox.json @@ -10,7 +10,8 @@ }, "axis=z": { "model": "create:block/gearbox/block", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/gearshift.json b/src/generated/resources/assets/create/blockstates/gearshift.json index edabe0d43..7efea836f 100644 --- a/src/generated/resources/assets/create/blockstates/gearshift.json +++ b/src/generated/resources/assets/create/blockstates/gearshift.json @@ -10,7 +10,8 @@ }, "axis=z,powered=false": { "model": "create:block/gearshift/block", - "x": 90 + "x": 90, + "y": 180 }, "axis=x,powered=true": { "model": "create:block/gearshift/block_powered", @@ -22,7 +23,8 @@ }, "axis=z,powered=true": { "model": "create:block/gearshift/block_powered", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/granite_pillar.json b/src/generated/resources/assets/create/blockstates/granite_pillar.json index 0079e858d..8d01d6201 100644 --- a/src/generated/resources/assets/create/blockstates/granite_pillar.json +++ b/src/generated/resources/assets/create/blockstates/granite_pillar.json @@ -10,7 +10,8 @@ }, "axis=z": { "model": "create:block/granite_pillar", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/large_cogwheel.json b/src/generated/resources/assets/create/blockstates/large_cogwheel.json index 6c1b017c6..620157584 100644 --- a/src/generated/resources/assets/create/blockstates/large_cogwheel.json +++ b/src/generated/resources/assets/create/blockstates/large_cogwheel.json @@ -10,7 +10,8 @@ }, "axis=z": { "model": "create:block/large_cogwheel", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/limestone_pillar.json b/src/generated/resources/assets/create/blockstates/limestone_pillar.json index fbc855c5e..eebf52dc0 100644 --- a/src/generated/resources/assets/create/blockstates/limestone_pillar.json +++ b/src/generated/resources/assets/create/blockstates/limestone_pillar.json @@ -10,7 +10,8 @@ }, "axis=z": { "model": "create:block/limestone_pillar", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/rotation_chassis.json b/src/generated/resources/assets/create/blockstates/rotation_chassis.json index 87a1ea2eb..84c795b7a 100644 --- a/src/generated/resources/assets/create/blockstates/rotation_chassis.json +++ b/src/generated/resources/assets/create/blockstates/rotation_chassis.json @@ -89,8 +89,8 @@ }, { "when": { - "axis": "x", - "sticky_west": "true" + "sticky_west": "true", + "axis": "x" }, "apply": { "model": "create:block/rotation_chassis_side_x_sticky", @@ -99,8 +99,8 @@ }, { "when": { - "axis": "y", - "sticky_west": "true" + "sticky_west": "true", + "axis": "y" }, "apply": { "model": "create:block/rotation_chassis_side_y_sticky", @@ -109,8 +109,8 @@ }, { "when": { - "axis": "z", - "sticky_west": "true" + "sticky_west": "true", + "axis": "z" }, "apply": { "model": "create:block/rotation_chassis_side_z_sticky", @@ -119,8 +119,8 @@ }, { "when": { - "axis": "x", - "sticky_west": "false" + "sticky_west": "false", + "axis": "x" }, "apply": { "model": "create:block/rotation_chassis_side_x", @@ -129,8 +129,8 @@ }, { "when": { - "axis": "y", - "sticky_west": "false" + "sticky_west": "false", + "axis": "y" }, "apply": { "model": "create:block/rotation_chassis_side_y", @@ -139,8 +139,8 @@ }, { "when": { - "axis": "z", - "sticky_west": "false" + "sticky_west": "false", + "axis": "z" }, "apply": { "model": "create:block/rotation_chassis_side_z", @@ -149,8 +149,8 @@ }, { "when": { - "axis": "x", - "sticky_north": "true" + "sticky_north": "true", + "axis": "x" }, "apply": { "model": "create:block/rotation_chassis_side_x_sticky" @@ -158,8 +158,8 @@ }, { "when": { - "axis": "y", - "sticky_north": "true" + "sticky_north": "true", + "axis": "y" }, "apply": { "model": "create:block/rotation_chassis_side_y_sticky", @@ -168,8 +168,8 @@ }, { "when": { - "axis": "z", - "sticky_north": "true" + "sticky_north": "true", + "axis": "z" }, "apply": { "model": "create:block/rotation_chassis_side_x_sticky", @@ -178,8 +178,8 @@ }, { "when": { - "axis": "x", - "sticky_north": "false" + "sticky_north": "false", + "axis": "x" }, "apply": { "model": "create:block/rotation_chassis_side_x" @@ -187,8 +187,8 @@ }, { "when": { - "axis": "y", - "sticky_north": "false" + "sticky_north": "false", + "axis": "y" }, "apply": { "model": "create:block/rotation_chassis_side_y", @@ -197,8 +197,8 @@ }, { "when": { - "axis": "z", - "sticky_north": "false" + "sticky_north": "false", + "axis": "z" }, "apply": { "model": "create:block/rotation_chassis_side_x", @@ -207,8 +207,8 @@ }, { "when": { - "axis": "x", - "sticky_east": "true" + "sticky_east": "true", + "axis": "x" }, "apply": { "model": "create:block/rotation_chassis_side_x_sticky", @@ -217,8 +217,8 @@ }, { "when": { - "axis": "y", - "sticky_east": "true" + "sticky_east": "true", + "axis": "y" }, "apply": { "model": "create:block/rotation_chassis_side_y_sticky", @@ -227,8 +227,8 @@ }, { "when": { - "axis": "z", - "sticky_east": "true" + "sticky_east": "true", + "axis": "z" }, "apply": { "model": "create:block/rotation_chassis_side_z_sticky" @@ -236,8 +236,8 @@ }, { "when": { - "axis": "x", - "sticky_east": "false" + "sticky_east": "false", + "axis": "x" }, "apply": { "model": "create:block/rotation_chassis_side_x", @@ -246,8 +246,8 @@ }, { "when": { - "axis": "y", - "sticky_east": "false" + "sticky_east": "false", + "axis": "y" }, "apply": { "model": "create:block/rotation_chassis_side_y", @@ -256,8 +256,8 @@ }, { "when": { - "axis": "z", - "sticky_east": "false" + "sticky_east": "false", + "axis": "z" }, "apply": { "model": "create:block/rotation_chassis_side_z" diff --git a/src/generated/resources/assets/create/blockstates/scoria_pillar.json b/src/generated/resources/assets/create/blockstates/scoria_pillar.json index 5ffa68a73..b7e1e85f8 100644 --- a/src/generated/resources/assets/create/blockstates/scoria_pillar.json +++ b/src/generated/resources/assets/create/blockstates/scoria_pillar.json @@ -10,7 +10,8 @@ }, "axis=z": { "model": "create:block/scoria_pillar", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/shaft.json b/src/generated/resources/assets/create/blockstates/shaft.json index 05a711a6e..c4cc5b98b 100644 --- a/src/generated/resources/assets/create/blockstates/shaft.json +++ b/src/generated/resources/assets/create/blockstates/shaft.json @@ -10,7 +10,8 @@ }, "axis=z": { "model": "create:block/shaft", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/translation_chassis.json b/src/generated/resources/assets/create/blockstates/translation_chassis.json index ce8469a2c..5ea915fc3 100644 --- a/src/generated/resources/assets/create/blockstates/translation_chassis.json +++ b/src/generated/resources/assets/create/blockstates/translation_chassis.json @@ -10,7 +10,8 @@ }, "axis=z,sticky_bottom=false,sticky_top=false": { "model": "create:block/translation_chassis", - "x": 90 + "x": 90, + "y": 180 }, "axis=x,sticky_bottom=true,sticky_top=false": { "model": "create:block/translation_chassis_bottom", @@ -22,7 +23,8 @@ }, "axis=z,sticky_bottom=true,sticky_top=false": { "model": "create:block/translation_chassis_bottom", - "x": 90 + "x": 90, + "y": 180 }, "axis=x,sticky_bottom=false,sticky_top=true": { "model": "create:block/translation_chassis_top", @@ -34,7 +36,8 @@ }, "axis=z,sticky_bottom=false,sticky_top=true": { "model": "create:block/translation_chassis_top", - "x": 90 + "x": 90, + "y": 180 }, "axis=x,sticky_bottom=true,sticky_top=true": { "model": "create:block/translation_chassis_top_bottom", @@ -46,7 +49,8 @@ }, "axis=z,sticky_bottom=true,sticky_top=true": { "model": "create:block/translation_chassis_top_bottom", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/translation_chassis_secondary.json b/src/generated/resources/assets/create/blockstates/translation_chassis_secondary.json index 775ce3fb9..087203b05 100644 --- a/src/generated/resources/assets/create/blockstates/translation_chassis_secondary.json +++ b/src/generated/resources/assets/create/blockstates/translation_chassis_secondary.json @@ -10,7 +10,8 @@ }, "axis=z,sticky_bottom=false,sticky_top=false": { "model": "create:block/translation_chassis_secondary", - "x": 90 + "x": 90, + "y": 180 }, "axis=x,sticky_bottom=true,sticky_top=false": { "model": "create:block/translation_chassis_secondary_bottom", @@ -22,7 +23,8 @@ }, "axis=z,sticky_bottom=true,sticky_top=false": { "model": "create:block/translation_chassis_secondary_bottom", - "x": 90 + "x": 90, + "y": 180 }, "axis=x,sticky_bottom=false,sticky_top=true": { "model": "create:block/translation_chassis_secondary_top", @@ -34,7 +36,8 @@ }, "axis=z,sticky_bottom=false,sticky_top=true": { "model": "create:block/translation_chassis_secondary_top", - "x": 90 + "x": 90, + "y": 180 }, "axis=x,sticky_bottom=true,sticky_top=true": { "model": "create:block/translation_chassis_secondary_top_bottom", @@ -46,7 +49,8 @@ }, "axis=z,sticky_bottom=true,sticky_top=true": { "model": "create:block/translation_chassis_secondary_top_bottom", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/weathered_limestone_pillar.json b/src/generated/resources/assets/create/blockstates/weathered_limestone_pillar.json index e4d3f81fc..caa909816 100644 --- a/src/generated/resources/assets/create/blockstates/weathered_limestone_pillar.json +++ b/src/generated/resources/assets/create/blockstates/weathered_limestone_pillar.json @@ -10,7 +10,8 @@ }, "axis=z": { "model": "create:block/weathered_limestone_pillar", - "x": 90 + "x": 90, + "y": 180 } } } \ No newline at end of file diff --git a/src/generated/resources/data/create/loot_tables/blocks/extractor.json b/src/generated/resources/data/create/loot_tables/blocks/extractor.json index 78793172c..3a44e834b 100644 --- a/src/generated/resources/data/create/loot_tables/blocks/extractor.json +++ b/src/generated/resources/data/create/loot_tables/blocks/extractor.json @@ -6,7 +6,7 @@ "entries": [ { "type": "minecraft:item", - "name": "minecraft:air" + "name": "create:extractor" } ], "conditions": [ diff --git a/src/generated/resources/data/create/loot_tables/blocks/transposer.json b/src/generated/resources/data/create/loot_tables/blocks/transposer.json index 78793172c..846ecd381 100644 --- a/src/generated/resources/data/create/loot_tables/blocks/transposer.json +++ b/src/generated/resources/data/create/loot_tables/blocks/transposer.json @@ -6,7 +6,7 @@ "entries": [ { "type": "minecraft:item", - "name": "minecraft:air" + "name": "create:transposer" } ], "conditions": [ diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntityRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntityRenderer.java index 9bfd0e88a..acd0d6db6 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntityRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntityRenderer.java @@ -38,18 +38,18 @@ public class KineticTileEntityRenderer extends SafeTileEntityRenderer property : state.getProperties()) { if (!(property instanceof IntegerProperty)) continue; - if (!property.getName().equals(BlockStateProperties.AGE_0_1.getName())) + if (!property.getName() + .equals(BlockStateProperties.AGE_0_1.getName())) continue; - if (((IntegerProperty) property).getAllowedValues().size() - 1 != state.get((IntegerProperty) property) + if (((IntegerProperty) property).getAllowedValues() + .size() - 1 != state.get((IntegerProperty) property) .intValue()) continue; return true; @@ -97,18 +100,20 @@ public class HarvesterMovementBehaviour extends MovementBehaviour { return false; } - + private boolean isValidOther(World world, BlockPos pos, BlockState state) { if (state.getBlock() instanceof CropsBlock) return false; if (state.getBlock() instanceof SugarCaneBlock) return true; - if (state.getCollisionShape(world, pos).isEmpty() || state.getBlock() instanceof CocoaBlock) { + if (state.getCollisionShape(world, pos) + .isEmpty() || state.getBlock() instanceof CocoaBlock) { for (IProperty property : state.getProperties()) { if (!(property instanceof IntegerProperty)) continue; - if (!property.getName().equals(BlockStateProperties.AGE_0_1.getName())) + if (!property.getName() + .equals(BlockStateProperties.AGE_0_1.getName())) continue; return false; } @@ -128,23 +133,29 @@ public class HarvesterMovementBehaviour extends MovementBehaviour { return crop.withAge(0); } if (state.getBlock() == Blocks.SUGAR_CANE) { - if (state.getFluidState().isEmpty()) + if (state.getFluidState() + .isEmpty()) return Blocks.AIR.getDefaultState(); - return state.getFluidState().getBlockState(); + return state.getFluidState() + .getBlockState(); } - if (state.getCollisionShape(world, pos).isEmpty() || state.getBlock() instanceof CocoaBlock) { + if (state.getCollisionShape(world, pos) + .isEmpty() || state.getBlock() instanceof CocoaBlock) { for (IProperty property : state.getProperties()) { if (!(property instanceof IntegerProperty)) continue; - if (!property.getName().equals(BlockStateProperties.AGE_0_1.getName())) + if (!property.getName() + .equals(BlockStateProperties.AGE_0_1.getName())) continue; return state.with((IntegerProperty) property, Integer.valueOf(0)); } } - if (state.getFluidState().isEmpty()) + if (state.getFluidState() + .isEmpty()) return Blocks.AIR.getDefaultState(); - return state.getFluidState().getBlockState(); + return state.getFluidState() + .getBlockState(); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterRenderer.java index de4ff7668..53168cf56 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterRenderer.java @@ -7,18 +7,18 @@ import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer; import com.simibubi.create.foundation.utility.AnimationTickHolder; +import com.simibubi.create.foundation.utility.MatrixStacker; import com.simibubi.create.foundation.utility.SuperByteBuffer; import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.BlockState; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; +import net.minecraft.util.math.Vec3d; public class HarvesterRenderer extends SafeTileEntityRenderer { @@ -28,42 +28,44 @@ public class HarvesterRenderer extends SafeTileEntityRenderer FilterItem.test(context.world, stack, filter), 1, false); + stack -> FilterItem.test(context.world, stack, filter), 1, false); player.setHeldItem(Hand.MAIN_HAND, held); } } @@ -125,7 +127,7 @@ public class DeployerMovementBehaviour extends MovementBehaviour { continue; if (list == inv.mainInventory && i == inv.currentItem - && FilterItem.test(context.world, itemstack, filter)) + && FilterItem.test(context.world, itemstack, filter)) continue; dropItem(context, itemstack); @@ -139,7 +141,8 @@ public class DeployerMovementBehaviour extends MovementBehaviour { DeployerFakePlayer player = getPlayer(context); if (player == null) return; - context.data.put("HeldItem", player.getHeldItemMainhand().serializeNBT()); + context.data.put("HeldItem", player.getHeldItemMainhand() + .serializeNBT()); } private DeployerFakePlayer getPlayer(MovementContext context) { @@ -163,9 +166,9 @@ public class DeployerMovementBehaviour extends MovementBehaviour { } @Override - @OnlyIn(Dist.CLIENT) - public List renderListInContraption(MovementContext context) { - return DeployerTileEntityRenderer.renderListInContraption(context); + public void renderInContraption(MovementContext context, MatrixStack ms, MatrixStack msLocal, + IRenderTypeBuffer buffers) { + DeployerTileEntityRenderer.renderInContraption(context, ms, msLocal, buffers); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntityRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntityRenderer.java index e06fc0608..53c1809bc 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntityRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntityRenderer.java @@ -3,9 +3,6 @@ package com.simibubi.create.content.contraptions.components.deployer; import static com.simibubi.create.content.contraptions.base.DirectionalAxisKineticBlock.AXIS_ALONG_FIRST_COORDINATE; import static com.simibubi.create.content.contraptions.base.DirectionalKineticBlock.FACING; -import java.util.Arrays; -import java.util.List; - import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; import com.simibubi.create.AllBlockPartials; @@ -26,6 +23,7 @@ import net.minecraft.block.BlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.Matrix4f; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.Vector3f; import net.minecraft.client.renderer.WorldRenderer; @@ -45,17 +43,17 @@ public class DeployerTileEntityRenderer extends SafeTileEntityRenderer renderListInContraption(MovementContext context) { + public static void renderInContraption(MovementContext context, MatrixStack ms, MatrixStack msLocal, + IRenderTypeBuffer buffer) { + MatrixStack[] matrixStacks = new MatrixStack[] { ms, msLocal }; + IVertexBuilder builder = buffer.getBuffer(RenderType.getSolid()); BlockState blockState = context.state; BlockPos pos = BlockPos.ZERO; Mode mode = NBTHelper.readEnum(context.tileData.getString("Mode"), Mode.class); @@ -169,16 +175,23 @@ public class DeployerTileEntityRenderer extends SafeTileEntityRenderer protected void renderShaft(SawTileEntity te, MatrixStack ms, IRenderTypeBuffer buffer, int light, int overlay) { - KineticTileEntityRenderer.renderRotatingBuffer(te, getRotatedModel(te), ms, buffer.getBuffer(RenderType.getSolid())); + KineticTileEntityRenderer.renderRotatingBuffer(te, getRotatedModel(te), ms, buffer.getBuffer(RenderType.getSolid()), light); } protected void renderItems(SawTileEntity te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffer, int light, diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntityRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntityRenderer.java index af6d84792..af7aff573 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntityRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntityRenderer.java @@ -1,22 +1,15 @@ package com.simibubi.create.content.contraptions.components.structureMovement; import com.mojang.blaze3d.matrix.MatrixStack; -import com.mojang.blaze3d.platform.GlStateManager; -import com.mojang.blaze3d.systems.RenderSystem; -import com.simibubi.create.foundation.utility.TessellatorHelper; -import com.simibubi.create.foundation.utility.VecHelper; +import com.simibubi.create.foundation.utility.MatrixStacker; +import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.IRenderTypeBuffer; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.client.renderer.entity.EntityRendererManager; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.entity.Entity; import net.minecraft.entity.item.minecart.AbstractMinecartEntity; -import net.minecraft.util.Direction.Axis; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; @@ -33,22 +26,18 @@ public class ContraptionEntityRenderer extends EntityRenderer @Override public void render(ContraptionEntity entity, float yaw, float partialTicks, MatrixStack ms, - IRenderTypeBuffer buffers, int overlay) { + IRenderTypeBuffer buffers, int overlay) { if (!entity.isAlive()) return; if (entity.getContraption() == null) return; - if (entity.getContraption().getType() == AllContraptionTypes.MOUNTED && entity.getRidingEntity() == null) + if (entity.getContraption() + .getType() == AllContraptionTypes.MOUNTED && entity.getRidingEntity() == null) return; - // TODO 1.15 buffered render - RenderSystem.pushMatrix(); - long randomBits = (long) entity.getEntityId() * 493286711L; - randomBits = randomBits * randomBits * 4392167121L + randomBits * 98761L; - float xNudge = (((float) (randomBits >> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; - float yNudge = (((float) (randomBits >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; - float zNudge = (((float) (randomBits >> 24 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; - RenderSystem.translatef(xNudge, yNudge, zNudge); + // Keep a copy of the transforms in order to determine correct lighting + MatrixStack msLocal = getLocalTransform(entity); + MatrixStack[] matrixStacks = new MatrixStack[] { ms, msLocal }; float degYaw = entity.getYaw(partialTicks); float degPitch = entity.getPitch(partialTicks); @@ -58,15 +47,18 @@ public class ContraptionEntityRenderer extends EntityRenderer float anglePitch = (float) (degPitch / 180 * Math.PI); float angleRoll = (float) (degRoll / 180 * Math.PI); + ms.push(); Entity ridingEntity = entity.getRidingEntity(); if (ridingEntity != null && ridingEntity instanceof AbstractMinecartEntity) { AbstractMinecartEntity cart = (AbstractMinecartEntity) ridingEntity; - - double cartX = MathHelper.lerp((double) partialTicks, cart.lastTickPosX, cart.getX()); - double cartY = MathHelper.lerp((double) partialTicks, cart.lastTickPosY, cart.getY()); - double cartZ = MathHelper.lerp((double) partialTicks, cart.lastTickPosZ, cart.getZ()); + double cartX = MathHelper.lerp(partialTicks, cart.lastTickPosX, cart.getX()); + double cartY = MathHelper.lerp(partialTicks, cart.lastTickPosY, cart.getY()); + double cartZ = MathHelper.lerp(partialTicks, cart.lastTickPosZ, cart.getZ()); Vec3d cartPos = cart.getPos(cartX, cartY, cartZ); + for (MatrixStack stack : matrixStacks) + stack.translate(-.5f, 0, -.5f); + if (cartPos != null) { Vec3d cartPosFront = cart.getPosOffset(cartX, cartY, cartZ, (double) 0.3F); Vec3d cartPosBack = cart.getPosOffset(cartX, cartY, cartZ, (double) -0.3F); @@ -79,44 +71,32 @@ public class ContraptionEntityRenderer extends EntityRenderer cartY = (cartPosFront.y + cartPosBack.y) / 2.0D - cartY; cartZ = cartPos.z - cartZ; - RenderSystem.translatef((float) cartX, (float) cartY, (float) cartZ); + for (MatrixStack stack : matrixStacks) + stack.translate(cartX, cartY, cartZ); } - GlStateManager.translatef(-.5f, 0, -.5f); } - Vec3d rotationOffset = VecHelper.getCenterOf(BlockPos.ZERO); - TessellatorHelper.prepareFastRender(); - RenderSystem.enableCull(); - TessellatorHelper.begin(DefaultVertexFormats.BLOCK); - ContraptionRenderer.render(entity.world, entity.getContraption(), superByteBuffer -> { - superByteBuffer.translate(-rotationOffset.x, -rotationOffset.y, -rotationOffset.z); - superByteBuffer.rotate(Axis.X, angleRoll); - superByteBuffer.rotate(Axis.Y, angleYaw); - superByteBuffer.rotate(Axis.Z, anglePitch); - superByteBuffer.translate(rotationOffset.x, rotationOffset.y, rotationOffset.z); - }, ms, Tessellator.getInstance().getBuffer()); - TessellatorHelper.draw(); - - if (!entity.getContraption().customRenderTEs.isEmpty()) { - RenderSystem.pushMatrix(); - RenderSystem.translated(rotationOffset.x, rotationOffset.y, rotationOffset.z); - RenderSystem.rotatef(degPitch, 0, 0, 1); - RenderSystem.rotatef(degYaw, 0, 1, 0); - RenderSystem.rotatef(degRoll, 1, 0, 0); - RenderSystem.translated(-rotationOffset.x, -rotationOffset.y, -rotationOffset.z); - ContraptionRenderer.renderTEsWithGL(entity.world, entity.getContraption(), entity.getPositionVec(), - new Vec3d(degRoll, degYaw, degPitch), ms, buffers); - RenderSystem.popMatrix(); - } - - RenderSystem.disableCull(); - RenderSystem.popMatrix(); - RenderSystem.shadeModel(7424); - RenderSystem.alphaFunc(516, 0.1F); - RenderSystem.matrixMode(5888); - RenderHelper.enable(); + for (MatrixStack stack : matrixStacks) + MatrixStacker.of(stack) + .nudge(entity.getEntityId()) + .centre() + .rotateRadians(angleRoll, angleYaw, anglePitch) + .unCentre(); + ContraptionRenderer.render(entity.world, entity.getContraption(), ms, msLocal, buffers); + ms.pop(); super.render(entity, yaw, partialTicks, ms, buffers, overlay); } + protected MatrixStack getLocalTransform(ContraptionEntity entity) { + double pt = Minecraft.getInstance() + .getRenderPartialTicks(); + MatrixStack matrixStack = new MatrixStack(); + double x = MathHelper.lerp(pt, entity.lastTickPosX, entity.getX()); + double y = MathHelper.lerp(pt, entity.lastTickPosY, entity.getY()); + double z = MathHelper.lerp(pt, entity.lastTickPosZ, entity.getZ()); + matrixStack.translate(x, y, z); + return matrixStack; + } + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionRenderer.java index cf7742bbc..ead238993 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionRenderer.java @@ -1,13 +1,14 @@ package com.simibubi.create.content.contraptions.components.structureMovement; import java.util.Random; -import java.util.function.Consumer; import org.apache.commons.lang3.tuple.Pair; import org.lwjgl.opengl.GL11; import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.IVertexBuilder; import com.simibubi.create.CreateClient; +import com.simibubi.create.foundation.utility.MatrixStacker; import com.simibubi.create.foundation.utility.SuperByteBuffer; import com.simibubi.create.foundation.utility.SuperByteBufferCache.Compartment; import com.simibubi.create.foundation.utility.TileEntityRenderHelper; @@ -20,11 +21,12 @@ import net.minecraft.client.renderer.BlockModelRenderer; import net.minecraft.client.renderer.BlockRendererDispatcher; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.IRenderTypeBuffer; +import net.minecraft.client.renderer.Matrix4f; +import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; import net.minecraft.world.LightType; import net.minecraft.world.World; import net.minecraft.world.gen.feature.template.Template.BlockInfo; @@ -35,25 +37,35 @@ public class ContraptionRenderer { public static final Compartment CONTRAPTION = new Compartment<>(); protected static PlacementSimulationWorld renderWorld; - public static void render(World world, Contraption c, Consumer transform, MatrixStack ms, - BufferBuilder buffer) { - SuperByteBuffer contraptionBuffer = - CreateClient.bufferCache.get(CONTRAPTION, c, () -> renderContraption(c, ms)); - transform.accept(contraptionBuffer); - contraptionBuffer.light((lx, ly, lz) -> getLight(world, lx, ly, lz)).renderInto(ms, buffer); - renderActors(world, c, transform, ms, buffer); + public static void render(World world, Contraption c, MatrixStack ms, MatrixStack msLocal, + IRenderTypeBuffer buffer) { + renderStructure(world, c, ms, msLocal, buffer); + renderTileEntities(world, c, ms, msLocal, buffer); + renderActors(world, c, ms, msLocal, buffer); } - public static void renderTEsWithGL(World world, Contraption c, Vec3d position, Vec3d rotation, MatrixStack ms, - IRenderTypeBuffer buffer) { - TileEntityRenderHelper.renderTileEntities(world, position, rotation, c.customRenderTEs, ms, buffer); + protected static void renderStructure(World world, Contraption c, MatrixStack ms, MatrixStack msLocal, + IRenderTypeBuffer buffer) { + IVertexBuilder translucent = buffer.getBuffer(RenderType.getTranslucent()); + SuperByteBuffer contraptionBuffer = CreateClient.bufferCache.get(CONTRAPTION, c, () -> buildStructureBuffer(c)); + Matrix4f model = msLocal.peek() + .getModel(); + contraptionBuffer.light(model) + .renderInto(ms, translucent); } - private static SuperByteBuffer renderContraption(Contraption c, MatrixStack ms) { + private static void renderTileEntities(World world, Contraption c, MatrixStack ms, MatrixStack msLocal, + IRenderTypeBuffer buffer) { + TileEntityRenderHelper.renderTileEntities(world, c.customRenderTEs, ms, msLocal, buffer); + } + + private static SuperByteBuffer buildStructureBuffer(Contraption c) { if (renderWorld == null || renderWorld.getWorld() != Minecraft.getInstance().world) renderWorld = new PlacementSimulationWorld(Minecraft.getInstance().world); - BlockRendererDispatcher dispatcher = Minecraft.getInstance().getBlockRendererDispatcher(); + MatrixStack ms = new MatrixStack(); + BlockRendererDispatcher dispatcher = Minecraft.getInstance() + .getBlockRendererDispatcher(); BlockModelRenderer blockRenderer = dispatcher.getBlockModelRenderer(); Random random = new Random(); BufferBuilder builder = new BufferBuilder(DefaultVertexFormats.BLOCK.getIntegerSize()); @@ -69,8 +81,11 @@ public class ContraptionRenderer { continue; IBakedModel originalModel = dispatcher.getModelForState(state); + ms.push(); + ms.translate(info.pos.getX(), info.pos.getY(), info.pos.getZ()); blockRenderer.renderModel(renderWorld, originalModel, state, info.pos, ms, builder, true, random, 42, - OverlayTexture.DEFAULT_UV, EmptyModelData.INSTANCE); + OverlayTexture.DEFAULT_UV, EmptyModelData.INSTANCE); + ms.pop(); } builder.finishDrawing(); @@ -78,28 +93,27 @@ public class ContraptionRenderer { return new SuperByteBuffer(builder); } - private static void renderActors(World world, Contraption c, Consumer transform, MatrixStack ms, - BufferBuilder buffer) { + private static void renderActors(World world, Contraption c, MatrixStack ms, MatrixStack msLocal, + IRenderTypeBuffer buffer) { + MatrixStack[] matrixStacks = new MatrixStack[] { ms, msLocal }; for (Pair actor : c.getActors()) { MovementContext context = actor.getRight(); if (context == null) continue; if (context.world == null) context.world = world; - BlockInfo blockInfo = actor.getLeft(); - for (SuperByteBuffer render : Contraption.getMovement(blockInfo.state).renderListInContraption(context)) { - if (render == null) - continue; - - int posX = blockInfo.pos.getX(); - int posY = blockInfo.pos.getY(); - int posZ = blockInfo.pos.getZ(); - - render.translate(posX, posY, posZ); - transform.accept(render); - render.light((lx, ly, lz) -> getLight(world, lx, ly, lz)).renderInto(ms, buffer); + for (MatrixStack m : matrixStacks) { + m.push(); + MatrixStacker.of(m) + .translate(blockInfo.pos); } + + Contraption.getMovement(blockInfo.state) + .renderInContraption(context, ms, msLocal, buffer); + + for (MatrixStack m : matrixStacks) + m.pop(); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/DirectionalExtenderScrollOptionSlot.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/DirectionalExtenderScrollOptionSlot.java index 0b63e5f23..874833491 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/DirectionalExtenderScrollOptionSlot.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/DirectionalExtenderScrollOptionSlot.java @@ -5,7 +5,7 @@ import java.util.function.BiPredicate; import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.foundation.tileEntity.behaviour.CenteredSideValueBoxTransform; import com.simibubi.create.foundation.utility.AngleHelper; -import com.simibubi.create.foundation.utility.VecHelper; +import com.simibubi.create.foundation.utility.MatrixStacker; import net.minecraft.block.BlockState; import net.minecraft.state.properties.BlockStateProperties; @@ -27,7 +27,7 @@ public class DirectionalExtenderScrollOptionSlot extends CenteredSideValueBoxTra @Override protected void rotate(BlockState state, MatrixStack ms) { if (!direction.getAxis().isHorizontal()) - ms.multiply(VecHelper.rotateY(AngleHelper.horizontalAngle(state.get(BlockStateProperties.FACING)) - 90)); + MatrixStacker.of(ms).rotateY(AngleHelper.horizontalAngle(state.get(BlockStateProperties.FACING)) - 90); super.rotate(state, ms); } } \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementBehaviour.java index 1664bec63..1be0ada51 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementBehaviour.java @@ -1,10 +1,8 @@ package com.simibubi.create.content.contraptions.components.structureMovement; -import java.util.Arrays; -import java.util.List; - -import com.simibubi.create.foundation.utility.SuperByteBuffer; +import com.mojang.blaze3d.matrix.MatrixStack; +import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.entity.item.ItemEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; @@ -19,14 +17,11 @@ public abstract class MovementBehaviour { return true; } - public void tick(MovementContext context) { - } + public void tick(MovementContext context) {} - public void startMoving(MovementContext context) { - } + public void startMoving(MovementContext context) {} - public void visitNewPosition(MovementContext context, BlockPos pos) { - } + public void visitNewPosition(MovementContext context, BlockPos pos) {} public Vec3d getActiveAreaOffset(MovementContext context) { return Vec3d.ZERO; @@ -39,26 +34,21 @@ public abstract class MovementBehaviour { Vec3d vec = context.position; ItemEntity itemEntity = new ItemEntity(context.world, vec.x, vec.y, vec.z, remainder); - itemEntity.setMotion(context.motion.add(0, 0.5f, 0).scale(context.world.rand.nextFloat() * .3f)); + itemEntity.setMotion(context.motion.add(0, 0.5f, 0) + .scale(context.world.rand.nextFloat() * .3f)); context.world.addEntity(itemEntity); } - @OnlyIn(value = Dist.CLIENT) - public SuperByteBuffer renderInContraption(MovementContext context) { - return null; - } - - @OnlyIn(value = Dist.CLIENT) - public List renderListInContraption(MovementContext context) { - return Arrays.asList(renderInContraption(context)); - } - public void stopMoving(MovementContext context) { - - } - - public void writeExtraData(MovementContext context) { - + } + public void writeExtraData(MovementContext context) { + + } + + @OnlyIn(Dist.CLIENT) + public void renderInContraption(MovementContext context, MatrixStack ms, MatrixStack msLocal, + IRenderTypeBuffer buffer) {} + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingTileEntityRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingTileEntityRenderer.java index 222a7ec14..84c19b603 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingTileEntityRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingTileEntityRenderer.java @@ -32,7 +32,7 @@ public class BearingTileEntityRenderer extends KineticTileEntityRenderer { if (facing.getAxis().isHorizontal()) superBuffer.rotateCentered(Axis.Y, AngleHelper.rad(AngleHelper.horizontalAngle(facing.getOpposite()))); float interpolatedAngle = bearingTe.getInterpolatedAngle(partialTicks - 1); - kineticRotationTransform(superBuffer, te, facing.getAxis(), (float) (interpolatedAngle / 180 * Math.PI)); + kineticRotationTransform(superBuffer, te, facing.getAxis(), (float) (interpolatedAngle / 180 * Math.PI), light); superBuffer.renderInto(ms, buffer.getBuffer(RenderType.getSolid())); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/LinearChassisBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/LinearChassisBlock.java index b42285124..77d3ba277 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/LinearChassisBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/LinearChassisBlock.java @@ -79,7 +79,7 @@ public class LinearChassisBlock extends AbstractChassisBlock { @Override public boolean reverseUVs(BlockState state, Direction face) { Axis axis = state.get(AXIS); - if (axis.isHorizontal() && (axis == Axis.Z ^ face.getAxisDirection() == AxisDirection.POSITIVE)) + if (axis.isHorizontal() && (face.getAxisDirection() == AxisDirection.POSITIVE)) return true; return super.reverseUVs(state, face); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerRenderer.java index 9e8c302bf..0bd5d9096 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerRenderer.java @@ -22,7 +22,7 @@ public class SpeedControllerRenderer extends SmartTileEntityRenderer> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; + float yNudge = (((float) (randomBits >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; + float zNudge = (((float) (randomBits >> 24 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; + ms.translate(xNudge, yNudge, zNudge); + return this; + } + + private MatrixStacker multiply(Vector3f axis, double angle) { + ms.multiply(axis.getDegreesQuaternion((float) angle)); + return this; + } + +} diff --git a/src/main/java/com/simibubi/create/foundation/utility/SuperByteBuffer.java b/src/main/java/com/simibubi/create/foundation/utility/SuperByteBuffer.java index b0abacbe0..a96c3a04c 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/SuperByteBuffer.java +++ b/src/main/java/com/simibubi/create/foundation/utility/SuperByteBuffer.java @@ -8,6 +8,7 @@ import com.mojang.blaze3d.vertex.IVertexBuilder; import com.mojang.datafixers.util.Pair; import com.simibubi.create.foundation.block.render.SpriteShiftEntry; +import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.BufferBuilder.DrawState; import net.minecraft.client.renderer.GLAllocation; @@ -18,6 +19,9 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats; 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.LightType; +import net.minecraft.world.World; public class SuperByteBuffer { @@ -40,9 +44,8 @@ public class SuperByteBuffer { // Vertex Lighting private boolean shouldLight; - private IVertexLighter vertexLighter; - private float lightOffsetX, lightOffsetY, lightOffsetZ; private int packedLightCoords; + private Matrix4f lightTransform; // Vertex Coloring private boolean shouldColor; @@ -54,8 +57,10 @@ public class SuperByteBuffer { ByteBuffer original = state.getSecond(); original.order(ByteOrder.nativeOrder()); // Vanilla bug, endianness does not carry over into sliced buffers this.original = original; - - this.mutable = GLAllocation.createDirectByteBuffer(state.getFirst().getCount() * buf.getVertexFormat().getSize()); + this.mutable = GLAllocation.createDirectByteBuffer(state.getFirst() + .getCount() + * buf.getVertexFormat() + .getSize()); this.mutable.order(original.order()); this.mutable.limit(original.limit()); mutable.put(this.original); @@ -64,16 +69,24 @@ public class SuperByteBuffer { transforms = new MatrixStack(); } - public ByteBuffer build(MatrixStack input) { + public ByteBuffer build(MatrixStack view) { original.rewind(); mutable.rewind(); - Matrix4f t = input.peek().getModel().copy(); - t.multiply(transforms.peek().getModel()); + Matrix4f t = view.peek() + .getModel() + .copy(); + Matrix4f localTransforms = transforms.peek() + .getModel(); + + t.multiply(localTransforms); + for (int vertex = 0; vertex < vertexCount(original); vertex++) { Vector4f pos = new Vector4f(getX(original, vertex), getY(original, vertex), getZ(original, vertex), 1F); - + Vector4f lightPos = new Vector4f(pos.getX(), pos.getY(), pos.getZ(), pos.getW()); + pos.transform(t); + lightPos.transform(localTransforms); putPos(mutable, vertex, pos.getX(), pos.getY(), pos.getZ()); if (shouldColor) { @@ -89,9 +102,9 @@ public class SuperByteBuffer { float u = getU(original, vertex); float v = getV(original, vertex); float targetU = spriteShift.getTarget() - .getInterpolatedU((getUnInterpolatedU(spriteShift.getOriginal(), u) / sheetSize) + uTarget * 16); + .getInterpolatedU((getUnInterpolatedU(spriteShift.getOriginal(), u) / sheetSize) + uTarget * 16); float targetV = spriteShift.getTarget() - .getInterpolatedV((getUnInterpolatedV(spriteShift.getOriginal(), v) / sheetSize) + vTarget * 16); + .getInterpolatedV((getUnInterpolatedV(spriteShift.getOriginal(), v) / sheetSize) + vTarget * 16); putUV(mutable, vertex, targetU, targetV); } @@ -99,11 +112,12 @@ public class SuperByteBuffer { putUV(mutable, vertex, getU(original, vertex), getV(original, vertex)); if (shouldLight) { - if (vertexLighter != null) - putLight(mutable, vertex, - vertexLighter.getPackedLight(pos.getX() + lightOffsetX, pos.getY() + lightOffsetY, pos.getZ() + lightOffsetZ)); - else - putLight(mutable, vertex, packedLightCoords); + int light = packedLightCoords; + if (lightTransform != null) { + lightPos.transform(lightTransform); + light = getLight(Minecraft.getInstance().world, lightPos); + } + putLight(mutable, vertex, light); } } @@ -114,12 +128,12 @@ public class SuperByteBuffer { mutable.rewind(); return mutable; } - + public static float getUnInterpolatedU(TextureAtlasSprite sprite, float u) { float f = sprite.getMaxU() - sprite.getMinU(); return (u - sprite.getMinU()) / f * 16.0F; } - + public static float getUnInterpolatedV(TextureAtlasSprite sprite, float v) { float f = sprite.getMaxV() - sprite.getMinV(); return (v - sprite.getMinV()) / f * 16.0F; @@ -132,7 +146,7 @@ public class SuperByteBuffer { // TODO 1.15 add "slow" path that writes all the data instead of using bulk put throw new IllegalArgumentException("Unsupported buffer type!"); } - ((BufferBuilder)buffer).putBulkData(build(input)); + ((BufferBuilder) buffer).putBulkData(build(input)); } public SuperByteBuffer translate(double x, double y, double z) { @@ -152,17 +166,19 @@ public class SuperByteBuffer { public SuperByteBuffer rotate(Direction axis, float radians) { if (radians == 0) return this; - transforms.multiply(axis.getUnitVector().getRadialQuaternion(radians)); + transforms.multiply(axis.getUnitVector() + .getRadialQuaternion(radians)); return this; } - + @Deprecated public SuperByteBuffer rotateCentered(Axis axis, float radians) { return rotateCentered(Direction.getFacingFromAxis(AxisDirection.POSITIVE, axis), radians); } - + public SuperByteBuffer rotateCentered(Direction axis, float radians) { - return translate(.5f, .5f, .5f).rotate(axis, radians).translate(-.5f, -.5f, -.5f); + return translate(.5f, .5f, .5f).rotate(axis, radians) + .translate(-.5f, -.5f, -.5f); } public SuperByteBuffer shiftUV(SpriteShiftEntry entry) { @@ -193,21 +209,14 @@ public class SuperByteBuffer { public SuperByteBuffer light(int packedLightCoords) { shouldLight = true; - vertexLighter = null; + lightTransform = null; this.packedLightCoords = packedLightCoords; return this; } - public SuperByteBuffer light(IVertexLighter lighter) { + public SuperByteBuffer light(Matrix4f lightTransform) { shouldLight = true; - vertexLighter = lighter; - return this; - } - - public SuperByteBuffer offsetLighting(double x, double y, double z) { - lightOffsetX = (float) x; - lightOffsetY = (float) y; - lightOffsetZ = (float) z; + this.lightTransform = lightTransform; return this; } @@ -290,4 +299,19 @@ public class SuperByteBuffer { buffer.put(bufferPosition + 15, a); } + private static int getLight(World world, Vector4f lightPos) { + BlockPos.Mutable pos = new BlockPos.Mutable(); + float sky = 0, block = 0; + float offset = 1 / 8f; + for (float zOffset = offset; zOffset >= -offset; zOffset -= 2 * offset) + for (float yOffset = offset; yOffset >= -offset; yOffset -= 2 * offset) + for (float xOffset = offset; xOffset >= -offset; xOffset -= 2 * offset) { + pos.setPos(lightPos.getX() + xOffset, lightPos.getY() + yOffset, lightPos.getZ() + zOffset); + sky += world.getLightLevel(LightType.SKY, pos) / 8f; + block += world.getLightLevel(LightType.BLOCK, pos) / 8f; + } + + return ((int) sky) << 20 | ((int) block) << 4; + } + } diff --git a/src/main/java/com/simibubi/create/foundation/utility/TileEntityRenderHelper.java b/src/main/java/com/simibubi/create/foundation/utility/TileEntityRenderHelper.java index 9ea079310..288093507 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/TileEntityRenderHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/TileEntityRenderHelper.java @@ -2,38 +2,36 @@ package com.simibubi.create.foundation.utility; import java.util.Iterator; -import org.lwjgl.opengl.GL13; - import com.mojang.blaze3d.matrix.MatrixStack; -import com.mojang.blaze3d.systems.RenderSystem; import com.simibubi.create.Create; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.utility.worldWrappers.WrappedWorld; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.IRenderTypeBuffer; -import net.minecraft.client.renderer.LightTexture; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.Matrix4f; +import net.minecraft.client.renderer.Vector4f; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.crash.ReportedException; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.world.LightType; import net.minecraft.world.World; public class TileEntityRenderHelper { protected static LightingWorld lightingWorld; - public static void renderTileEntities(World world, Vec3d position, Vec3d rotation, - Iterable customRenderTEs, MatrixStack ms, IRenderTypeBuffer buffer) { - float pt = Minecraft.getInstance().getRenderPartialTicks(); + public static void renderTileEntities(World world, Iterable customRenderTEs, MatrixStack ms, + MatrixStack localTransform, IRenderTypeBuffer buffer) { + float pt = Minecraft.getInstance() + .getRenderPartialTicks(); if (lightingWorld == null) lightingWorld = new LightingWorld(world); lightingWorld.setWorld(world); - lightingWorld.setTransform(position, rotation); + lightingWorld.setTransform(localTransform.peek() + .getModel()); for (Iterator iterator = customRenderTEs.iterator(); iterator.hasNext();) { TileEntity tileEntity = iterator.next(); @@ -45,29 +43,24 @@ public class TileEntityRenderHelper { try { BlockPos pos = tileEntity.getPos(); - if (!tileEntity.hasFastRenderer()) { - RenderHelper.enable(); - int i = WorldRenderer.getLightmapCoordinates(lightingWorld, pos); - int j = LightTexture.getBlockLightCoordinates(i); - int k = LightTexture.getSkyLightCoordinates(i); - RenderSystem.glMultiTexCoord2f(GL13.GL_TEXTURE1, (float) j, (float) k); - RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - RenderSystem.disableCull(); World prevTileWorld = tileEntity.getWorld(); + ms.push(); + MatrixStacker.of(ms) + .translate(pos); tileEntity.setLocation(lightingWorld, pos); TileEntityRendererDispatcher.instance.render(tileEntity, pt, ms, buffer); tileEntity.setLocation(prevTileWorld, pos); - RenderSystem.enableCull(); + ms.pop(); } catch (ReportedException e) { if (AllConfigs.CLIENT.explainRenderErrors.get()) { - Create.logger.error("TileEntity " + tileEntity.getType().getRegistryName().toString() - + " didn't want to render while moved.\n", e); + Create.logger.error("TileEntity " + tileEntity.getType() + .getRegistryName() + .toString() + " didn't want to render while moved.\n", e); } else { - Create.logger.error("TileEntity " + tileEntity.getType().getRegistryName().toString() - + " didn't want to render while moved.\n"); + Create.logger.error("TileEntity " + tileEntity.getType() + .getRegistryName() + .toString() + " didn't want to render while moved.\n"); } iterator.remove(); continue; @@ -77,8 +70,7 @@ public class TileEntityRenderHelper { private static class LightingWorld extends WrappedWorld { - private Vec3d offset; - private Vec3d rotation; + private Matrix4f matrix; public LightingWorld(World world) { super(world); @@ -88,21 +80,19 @@ public class TileEntityRenderHelper { this.world = world; } - void setTransform(Vec3d offset, Vec3d rotation) { - this.offset = offset; - this.rotation = rotation; + void setTransform(Matrix4f matrix) { + this.matrix = matrix; } @Override - public int getBaseLightLevel(BlockPos pos, int minLight) { - return super.getBaseLightLevel(transformPos(pos), minLight); + public int getLightLevel(LightType p_226658_1_, BlockPos p_226658_2_) { + return super.getLightLevel(p_226658_1_, transformPos(p_226658_2_)); } private BlockPos transformPos(BlockPos pos) { - Vec3d vec = VecHelper.getCenterOf(pos); - vec = VecHelper.rotate(vec, rotation.x, rotation.y, rotation.z); - vec = vec.add(offset).subtract(VecHelper.getCenterOf(BlockPos.ZERO)); - return new BlockPos(vec); + Vector4f vec = new Vector4f(pos.getX(), pos.getY(), pos.getZ(), 1); + vec.transform(matrix); + return new BlockPos(vec.getX(), vec.getY(), vec.getZ()); } } 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 e51ce41d0..1ad8edf3e 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/VecHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/VecHelper.java @@ -2,8 +2,6 @@ package com.simibubi.create.foundation.utility; import java.util.Random; -import net.minecraft.client.renderer.Quaternion; -import net.minecraft.client.renderer.Vector3f; import net.minecraft.nbt.DoubleNBT; import net.minecraft.nbt.ListNBT; import net.minecraft.util.Direction; @@ -12,8 +10,6 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3i; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; public class VecHelper { @@ -99,19 +95,4 @@ public class VecHelper { return true; } - @OnlyIn(Dist.CLIENT) - public static Quaternion rotateX(double angle) { - return Vector3f.POSITIVE_X.getDegreesQuaternion((float) angle); - } - - @OnlyIn(Dist.CLIENT) - public static Quaternion rotateY(double angle) { - return Vector3f.POSITIVE_Y.getDegreesQuaternion((float) angle); - } - - @OnlyIn(Dist.CLIENT) - public static Quaternion rotateZ(double angle) { - return Vector3f.POSITIVE_Z.getDegreesQuaternion((float) angle); - } - }