diff --git a/build.gradle b/build.gradle index 7477d5da9..0bd3d4bb2 100644 --- a/build.gradle +++ b/build.gradle @@ -39,7 +39,7 @@ minecraft { workingDirectory project.file('run') // property 'mixin.env.disableRefMap', 'true' arg '-mixin.config=create.mixins.json' -// jvmArgs '-XX:+UnlockCommercialFeatures' + jvmArgs '-XX:+UnlockCommercialFeatures' property 'forge.logging.console.level', 'info' property 'fml.earlyprogresswindow', 'false' mods { diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 1a3f42840..e5c3179d6 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -371,6 +371,7 @@ e815bfd854c2653f10828bb11950f7fb991d7efc assets/create/blockstates/speedometer.j 1cb7cdbefa0ff199263782809287854b9d85074c assets/create/blockstates/spout.json d62b7908119fa4f51715a186d0882b388bb25cab assets/create/blockstates/spruce_window.json 8d7dfa60630a8b4bae4e8eca5c66e1cfa34dda1f assets/create/blockstates/spruce_window_pane.json +5d7385d28a23dcfc95a221d36d82337908582726 assets/create/blockstates/sticker.json 3d93eabbb327aecc526beae9c62283f1d43eb710 assets/create/blockstates/sticky_mechanical_piston.json f385988cb6fa9c48b5d59a6942ec50ed2b60c8bf assets/create/blockstates/stockpile_switch.json e815bfd854c2653f10828bb11950f7fb991d7efc assets/create/blockstates/stressometer.json @@ -400,20 +401,6 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j 6801fa1f466f172700e573e5b8ee8ee5f9ca4583 assets/create/blockstates/yellow_valve_handle.json 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json -e3f618c5b622d21880de858678d1802cbf65e615 assets/create/lang/en_ud.json -3c37fa4654a24869c15a12e01d60b5bf38ed260b assets/create/lang/en_us.json -72f2d5e2d235338091671ff89f1225c427174eba assets/create/lang/unfinished/de_de.json -2c4140f942ca2c799a899d8aaa2cbc2fdbca780e assets/create/lang/unfinished/es_es.json -c42b6dda6a1f90763d7ef82c5fbce962febeb8db assets/create/lang/unfinished/es_mx.json -ca09de2a4554a79b1ed4e25538dc441c9aed68e2 assets/create/lang/unfinished/fr_fr.json -b599e283914c9b07f8c4fd5f875af8438065148d assets/create/lang/unfinished/it_it.json -7482b319553c7ae226fcea8c8e4908ce3fc01e6b assets/create/lang/unfinished/ja_jp.json -36b2f77f5365f99734bbb1565a478a5bb86300a1 assets/create/lang/unfinished/ko_kr.json -4981e34cecbe98823ac39fd1743647218c88b679 assets/create/lang/unfinished/nl_nl.json -2202c60512efb9de3c53ef47af98c78d0f26f012 assets/create/lang/unfinished/pt_br.json -209f7d43d6f0ea161881eeb9aaae9b909c75f2a7 assets/create/lang/unfinished/ru_ru.json -b330bf998d525c025c0f44063963be3b99158156 assets/create/lang/unfinished/zh_cn.json -dfb0014541a6953406195b51286e4c69e192a336 assets/create/lang/unfinished/zh_tw.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 @@ -1192,6 +1179,7 @@ afd697168c9786eb80e54eccdc6a23afa6c7fb0e assets/create/models/item/chiseled_gabb a47fbe5f2da79080d99ef0975bfa8da4d08f8be4 assets/create/models/item/chiseled_scoria.json 70232ce9b88119fb383717e2c1ad113f7aad6a99 assets/create/models/item/chiseled_weathered_limestone.json eabf1870127d78c920305228eb51ddf36c44d016 assets/create/models/item/chocolate_bucket.json +473c8fcc3c53a7680b2f1c6505517c79fd07153a assets/create/models/item/chocolate_glazed_berries.json fe67c3f380d17735a9436a4579a8be1a02b8e4a0 assets/create/models/item/chute.json d418205c83d3e57c830755ee8c09e2962353e493 assets/create/models/item/cinder_flour.json c1da21be9f1af4f7a2ef4ec9cd92195d65ada316 assets/create/models/item/clockwork_bearing.json @@ -1329,6 +1317,7 @@ b10f1b188f2bf380628377bd42af2b8f8ffe5611 assets/create/models/item/gantry_pinion b4bfd5041b62f3a0a955fa4872d178b590614f22 assets/create/models/item/gantry_shaft.json 6ab0d17f3d02678ed992e188ff09f6b2c00b5b03 assets/create/models/item/gearbox.json 2fe29893d74c176ea35aed73a169c13dd4ddb2a8 assets/create/models/item/gearshift.json +21c3dc6a734be582c149b9d1d7da209e178ed58a assets/create/models/item/goggles.json 52108a61865dab38133b9f916496ca680ae364ea assets/create/models/item/golden_sheet.json 46d813bcb6676078347383295bb7dbda1d9dd060 assets/create/models/item/granite_bricks.json 032a31c66d3de63595d478165d54b4f562e9831d assets/create/models/item/granite_bricks_slab.json @@ -1347,6 +1336,7 @@ ecb9f32f62d3fa43fb226ab85adc2eb229fdfb77 assets/create/models/item/green_valve_h cfab82a2cf7495d21778c1de9730a26afbdd523d assets/create/models/item/handheld_blockzapper.json dee43bf1a9c211a752fac2c07aeba123f7f0c914 assets/create/models/item/handheld_worldshaper.json 967695ab65edb8cb19e9759425f2d12d75406122 assets/create/models/item/honey_bucket.json +31809415a3119aeda37cff6f16d2cf47f71e097f assets/create/models/item/honeyed_apple.json e7ec65ad5be13cae5f7d60836b8df9e4a5baad56 assets/create/models/item/horizontal_framed_glass.json f0e3b2b8a553b6e61746c922c27302dabfff71b6 assets/create/models/item/horizontal_framed_glass_pane.json ff92f6a9dfb73a6ee1eaaed3279c89390ff04a80 assets/create/models/item/hose_pulley.json @@ -1541,10 +1531,12 @@ d6fb0d38b1b5bcc199b52ac8889eaecd167f6725 assets/create/models/item/speedometer.j b9abe1331d49871838231f3a8e5d2973634e9325 assets/create/models/item/spout.json b305e81f1dc5272634745b6e822af40955a2ef28 assets/create/models/item/spruce_window.json 5f622bca8386b8dd077310647e39ac3abb80c6a1 assets/create/models/item/spruce_window_pane.json +bb546e5342c6d1a6b4040cf7ccdd2f10c6f79965 assets/create/models/item/sticker.json 891abc24593d53d282773eca5534065056d89b4c assets/create/models/item/sticky_mechanical_piston.json bbb5773adc23128c70174bfc531af936e6e063e3 assets/create/models/item/stockpile_switch.json bab8f78c319b2a79ed55c5d2a94b521ddaa44996 assets/create/models/item/stressometer.json 29d571a061e3addf92ee51bfc55d96edc3a517a5 assets/create/models/item/super_glue.json +9be61d209d2219ca00d35de7cd57c2c87b297379 assets/create/models/item/sweet_roll.json b1d3d00ff05908feacad06a86800da96cc9bc65d assets/create/models/item/tiled_glass.json 8a2a81a8cbc52b6021e57107d79a32f73b82d8fe assets/create/models/item/tiled_glass_pane.json c081317f106a2b04700aafde12c57445844c20ab assets/create/models/item/tree_fertilizer.json @@ -1812,6 +1804,7 @@ cd8cefee21a1690f9158b8e8661a92d20ad0f535 data/create/advancements/recipes/create e8a5d924ccf30b6eae4b9ec0a8040e31f0eb165b data/create/advancements/recipes/create.base/crafting/kinetics/speedometer.json 90ff137eb1533695d9d17296ed180c0a88ddd891 data/create/advancements/recipes/create.base/crafting/kinetics/speedometerfrom_conversion.json 44867af16ec6d960268747effcd578ab55e3a366 data/create/advancements/recipes/create.base/crafting/kinetics/spout.json +8c7fd72b8b4d414a61859dd08857e8538d84f88b data/create/advancements/recipes/create.base/crafting/kinetics/sticker.json 3859abc8839e92b01461d3e9ef853a4934c3256b data/create/advancements/recipes/create.base/crafting/kinetics/sticky_mechanical_piston.json 9a4dad31370d9e71308afe5c3f9349b67f749635 data/create/advancements/recipes/create.base/crafting/kinetics/stressometerfrom_conversion.json f3fc3d4fee0712906f833aa17185f0bacb21922f data/create/advancements/recipes/create.base/crafting/kinetics/super_glue.json @@ -2661,6 +2654,7 @@ b127cb6920e6d7d9c8b2402cb186402a9a8dd3fc data/create/loot_tables/blocks/shaft.js f6c497d625de67ea9377e840208b1be539d13b73 data/create/loot_tables/blocks/spout.json a23a1e332c9ba84474e3c0588e8a0857afe346e0 data/create/loot_tables/blocks/spruce_window.json 3ee2350936ea82fef716bc58e4cd088a384616f0 data/create/loot_tables/blocks/spruce_window_pane.json +111a3bb893abb899652a923b10ca7dc5ea424e5f data/create/loot_tables/blocks/sticker.json 8d2970acd61b96844a4308d87e858b1612d5862e data/create/loot_tables/blocks/sticky_mechanical_piston.json ec2889e712702644092197a4b41a682fb953817d data/create/loot_tables/blocks/stockpile_switch.json 3479775008a256bc35f98b31655975f7d5c836b2 data/create/loot_tables/blocks/stressometer.json @@ -2872,6 +2866,7 @@ a17db27e61baa45f8a6ecb46a6d2a5a464704f8b data/create/recipes/crafting/kinetics/s b1a74f0b51fa37ca1ed814266b3d69b8b7e69fa3 data/create/recipes/crafting/kinetics/speedometer.json 8d632845deeb723e1a56083536ee5f9d60de2fcb data/create/recipes/crafting/kinetics/speedometerfrom_conversion.json eea9d4066cd2fafef40b50b79323dcc603fa6388 data/create/recipes/crafting/kinetics/spout.json +e532a5c405e48b415e3fcd4f7c6183ea335cb915 data/create/recipes/crafting/kinetics/sticker.json 3be40664acfd150d0617bc138dc2dd9d54a21b3a data/create/recipes/crafting/kinetics/sticky_mechanical_piston.json af5854ee2fa3be195ad9abcdeebe6ed7306b651c data/create/recipes/crafting/kinetics/stressometerfrom_conversion.json 21f885a674603367b67e1e993c175638cbda9ea3 data/create/recipes/crafting/kinetics/super_glue.json @@ -3113,12 +3108,15 @@ d2ab9ce73636773165564506580f2ec13bd1fc50 data/create/recipes/fancy_weathered_lim 1d0e41ca98e48073c72adf4077610c96e592f9a5 data/create/recipes/fancy_weathered_limestone_bricks_wall_from_fancy_weathered_limestone_bricks_stonecutting.json 133e79f78a7f2c2f63ac7695d2be57d56e8955f4 data/create/recipes/filling/blaze_cake.json 642e96ce5dd2f31e7a33c6ef4060eecb0bf2aa86 data/create/recipes/filling/builders_tea.json +1367357fc36adc4b67467d90589ef91e657380a4 data/create/recipes/filling/chocolate_glazed_berries.json 5bec6c2068a3c1005810d18bd45ce916389b5423 data/create/recipes/filling/glowstone.json 5eb6227ccb6fa940b662d3ec029c3bd61fe61c8d data/create/recipes/filling/grass_block.json 244f27eadefefbc966ac384ac087c57d19484321 data/create/recipes/filling/gunpowder.json c8ca74a6cd071308a1750a2ad1153e79422598a0 data/create/recipes/filling/honey_bottle.json +d20703b67dd5e4c9b75718db02d575b1c7415c12 data/create/recipes/filling/honeyed_apple.json c83e77a9799b6ca34dd73aa76b56159f2103c48c data/create/recipes/filling/milk_bucket.json 08ce1420d1551ecfef5988977436c087123851a6 data/create/recipes/filling/redstone.json +fb8e4378cd2240644a4b5c0d06e27ad772ec7695 data/create/recipes/filling/sweet_roll.json 5b8bbde7f8b270ab75fac18d6858f2fadbc0efa3 data/create/recipes/framed_glass_from_glass_colorless_stonecutting.json d697de0c9b706ca4e18da7a2d769e7e5fe8d769d data/create/recipes/framed_glass_pane.json a0dae50faaa1b7142bb4309675e3084c68daa547 data/create/recipes/gabbro_bricks_from_gabbro_stonecutting.json @@ -3540,7 +3538,7 @@ eac71740fb12bdb38b5dfaa2268613d7ba82b809 data/create/tags/blocks/windmill_sails. 081f5aa35602fc27af2ca01ea9f2fd5e7eb284dc data/create/tags/items/create_ingots.json 94c62bf22678ef55b2b8a5398a7960e5b00682dc data/create/tags/items/crushed_ores.json 6cdeeac1689f7b5bfd9bc40b462143d8eaf3ad0b data/create/tags/items/seats.json -43ae6f21db7b43984e163af11f4e6cc80459803a data/create/tags/items/upright_on_belt.json +c7efc23c08d5e3602c84ff43dac18f72b1cfced3 data/create/tags/items/upright_on_belt.json 50936b211d94167a35ec78c89954082a336b6269 data/create/tags/items/valve_handles.json 16bcb8fcbe9170c2c11f1ca8d99d8b36cd812bbd data/forge/tags/blocks/glass/colorless.json 81ced867d24ec814942909965dd4576eff1db685 data/forge/tags/blocks/glass_panes.json diff --git a/src/generated/resources/assets/create/blockstates/sticker.json b/src/generated/resources/assets/create/blockstates/sticker.json new file mode 100644 index 000000000..1949f8b4e --- /dev/null +++ b/src/generated/resources/assets/create/blockstates/sticker.json @@ -0,0 +1,108 @@ +{ + "variants": { + "extended=false,facing=down,powered=false": { + "model": "create:block/sticker/block", + "x": 180 + }, + "extended=true,facing=down,powered=false": { + "model": "create:block/sticker/block", + "x": 180 + }, + "extended=false,facing=up,powered=false": { + "model": "create:block/sticker/block" + }, + "extended=true,facing=up,powered=false": { + "model": "create:block/sticker/block" + }, + "extended=false,facing=north,powered=false": { + "model": "create:block/sticker/block", + "x": 90 + }, + "extended=true,facing=north,powered=false": { + "model": "create:block/sticker/block", + "x": 90 + }, + "extended=false,facing=south,powered=false": { + "model": "create:block/sticker/block", + "x": 90, + "y": 180 + }, + "extended=true,facing=south,powered=false": { + "model": "create:block/sticker/block", + "x": 90, + "y": 180 + }, + "extended=false,facing=west,powered=false": { + "model": "create:block/sticker/block", + "x": 90, + "y": 270 + }, + "extended=true,facing=west,powered=false": { + "model": "create:block/sticker/block", + "x": 90, + "y": 270 + }, + "extended=false,facing=east,powered=false": { + "model": "create:block/sticker/block", + "x": 90, + "y": 90 + }, + "extended=true,facing=east,powered=false": { + "model": "create:block/sticker/block", + "x": 90, + "y": 90 + }, + "extended=false,facing=down,powered=true": { + "model": "create:block/sticker/block_powered", + "x": 180 + }, + "extended=true,facing=down,powered=true": { + "model": "create:block/sticker/block_powered", + "x": 180 + }, + "extended=false,facing=up,powered=true": { + "model": "create:block/sticker/block_powered" + }, + "extended=true,facing=up,powered=true": { + "model": "create:block/sticker/block_powered" + }, + "extended=false,facing=north,powered=true": { + "model": "create:block/sticker/block_powered", + "x": 90 + }, + "extended=true,facing=north,powered=true": { + "model": "create:block/sticker/block_powered", + "x": 90 + }, + "extended=false,facing=south,powered=true": { + "model": "create:block/sticker/block_powered", + "x": 90, + "y": 180 + }, + "extended=true,facing=south,powered=true": { + "model": "create:block/sticker/block_powered", + "x": 90, + "y": 180 + }, + "extended=false,facing=west,powered=true": { + "model": "create:block/sticker/block_powered", + "x": 90, + "y": 270 + }, + "extended=true,facing=west,powered=true": { + "model": "create:block/sticker/block_powered", + "x": 90, + "y": 270 + }, + "extended=false,facing=east,powered=true": { + "model": "create:block/sticker/block_powered", + "x": 90, + "y": 90 + }, + "extended=true,facing=east,powered=true": { + "model": "create:block/sticker/block_powered", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/lang/en_ud.json b/src/generated/resources/assets/create/lang/en_ud.json index 65c0554be..992efe5b8 100644 --- a/src/generated/resources/assets/create/lang/en_ud.json +++ b/src/generated/resources/assets/create/lang/en_ud.json @@ -372,6 +372,7 @@ "block.create.spout": "\u0287nodS", "block.create.spruce_window": "\u028Dopu\u0131M \u01DD\u0254n\u0279dS", "block.create.spruce_window_pane": "\u01DDu\u0250\u0500 \u028Dopu\u0131M \u01DD\u0254n\u0279dS", + "block.create.sticker": "\u0279\u01DD\u029E\u0254\u0131\u0287S", "block.create.sticky_mechanical_piston": "uo\u0287s\u0131\u0500 \u05DF\u0250\u0254\u0131u\u0250\u0265\u0254\u01DDW \u028E\u029E\u0254\u0131\u0287S", "block.create.stockpile_switch": "\u0265\u0254\u0287\u0131\u028DS \u01DD\u05DF\u0131d\u029E\u0254o\u0287S", "block.create.stressometer": "\u0279\u01DD\u0287\u01DD\u026Foss\u01DD\u0279\u0287S", @@ -422,6 +423,7 @@ "item.create.builders_tea": "\u0250\u01DD\u27D8 s,\u0279\u01DDp\u05DF\u0131n\u15FA", "item.create.chest_minecart_contraption": "uo\u0131\u0287d\u0250\u0279\u0287uo\u0186 \u0287\u0279\u0250\u0254\u01DDu\u0131W \u0287s\u01DD\u0265\u0186", "item.create.chocolate_bucket": "\u0287\u01DD\u029E\u0254n\u15FA \u01DD\u0287\u0250\u05DFo\u0254o\u0265\u0186", + "item.create.chocolate_glazed_berries": "s\u01DD\u0131\u0279\u0279\u01DD\u15FA p\u01DDz\u0250\u05DF\u2141 \u01DD\u0287\u0250\u05DFo\u0254o\u0265\u0186", "item.create.chromatic_compound": "punod\u026Fo\u0186 \u0254\u0131\u0287\u0250\u026Fo\u0279\u0265\u0186", "item.create.cinder_flour": "\u0279no\u05DF\u2132 \u0279\u01DDpu\u0131\u0186", "item.create.copper_ingot": "\u0287obuI \u0279\u01DDddo\u0186", @@ -455,6 +457,7 @@ "item.create.handheld_blockzapper": "\u0279\u01DDdd\u0250z\u029E\u0254o\u05DF\u15FA p\u05DF\u01DD\u0265pu\u0250H", "item.create.handheld_worldshaper": "\u0279\u01DDd\u0250\u0265sp\u05DF\u0279oM p\u05DF\u01DD\u0265pu\u0250H", "item.create.honey_bucket": "\u0287\u01DD\u029E\u0254n\u15FA \u028E\u01DDuoH", + "item.create.honeyed_apple": "\u01DD\u05DFdd\u2C6F p\u01DD\u028E\u01DDuoH", "item.create.integrated_circuit": "\u0287\u0131n\u0254\u0279\u0131\u0186 p\u01DD\u0287\u0250\u0279b\u01DD\u0287uI", "item.create.iron_sheet": "\u0287\u01DD\u01DD\u0265S uo\u0279I", "item.create.lapis_sheet": "\u0287\u01DD\u01DD\u0265S s\u0131d\u0250\uA780", @@ -471,6 +474,7 @@ "item.create.schematic_and_quill": "\u05DF\u05DF\u0131n\u1F49 pu\u2C6F \u0254\u0131\u0287\u0250\u026F\u01DD\u0265\u0254S", "item.create.shadow_steel": "\u05DF\u01DD\u01DD\u0287S \u028Dop\u0250\u0265S", "item.create.super_glue": "\u01DDn\u05DF\u2141 \u0279\u01DDdnS", + "item.create.sweet_roll": "\u05DF\u05DFo\u1D1A \u0287\u01DD\u01DD\u028DS", "item.create.tree_fertilizer": "\u0279\u01DDz\u0131\u05DF\u0131\u0287\u0279\u01DD\u2132 \u01DD\u01DD\u0279\u27D8", "item.create.vertical_gearbox": "xoq\u0279\u0250\u01DD\u2141 \u05DF\u0250\u0254\u0131\u0287\u0279\u01DD\u039B", "item.create.wand_of_symmetry": "\u028E\u0279\u0287\u01DD\u026F\u026F\u028ES \u025FO pu\u0250M", diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index 73b8a7182..2afe2bfdf 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -375,6 +375,7 @@ "block.create.spout": "Spout", "block.create.spruce_window": "Spruce Window", "block.create.spruce_window_pane": "Spruce Window Pane", + "block.create.sticker": "Sticker", "block.create.sticky_mechanical_piston": "Sticky Mechanical Piston", "block.create.stockpile_switch": "Stockpile Switch", "block.create.stressometer": "Stressometer", @@ -428,6 +429,7 @@ "item.create.builders_tea": "Builder's Tea", "item.create.chest_minecart_contraption": "Chest Minecart Contraption", "item.create.chocolate_bucket": "Chocolate Bucket", + "item.create.chocolate_glazed_berries": "Chocolate Glazed Berries", "item.create.chromatic_compound": "Chromatic Compound", "item.create.cinder_flour": "Cinder Flour", "item.create.copper_ingot": "Copper Ingot", @@ -461,6 +463,7 @@ "item.create.handheld_blockzapper": "Handheld Blockzapper", "item.create.handheld_worldshaper": "Handheld Worldshaper", "item.create.honey_bucket": "Honey Bucket", + "item.create.honeyed_apple": "Honeyed Apple", "item.create.integrated_circuit": "Integrated Circuit", "item.create.iron_sheet": "Iron Sheet", "item.create.lapis_sheet": "Lapis Sheet", @@ -477,6 +480,7 @@ "item.create.schematic_and_quill": "Schematic And Quill", "item.create.shadow_steel": "Shadow Steel", "item.create.super_glue": "Super Glue", + "item.create.sweet_roll": "Sweet Roll", "item.create.tree_fertilizer": "Tree Fertilizer", "item.create.vertical_gearbox": "Vertical Gearbox", "item.create.wand_of_symmetry": "Wand Of Symmetry", 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 755fde66b..b4f514fa1 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: 985", + "_": "->------------------------] Game Elements [------------------------<-", @@ -376,6 +376,7 @@ "block.create.spout": "UNLOCALIZED: Spout", "block.create.spruce_window": "UNLOCALIZED: Spruce Window", "block.create.spruce_window_pane": "UNLOCALIZED: Spruce Window Pane", + "block.create.sticker": "UNLOCALIZED: Sticker", "block.create.sticky_mechanical_piston": "Klebriger Mechanischer Kolben", "block.create.stockpile_switch": "Vorratssensor", "block.create.stressometer": "UNLOCALIZED: Stressometer", @@ -429,6 +430,7 @@ "item.create.builders_tea": "UNLOCALIZED: Builder's Tea", "item.create.chest_minecart_contraption": "UNLOCALIZED: Chest Minecart Contraption", "item.create.chocolate_bucket": "UNLOCALIZED: Chocolate Bucket", + "item.create.chocolate_glazed_berries": "UNLOCALIZED: Chocolate Glazed Berries", "item.create.chromatic_compound": "UNLOCALIZED: Chromatic Compound", "item.create.cinder_flour": "UNLOCALIZED: Cinder Flour", "item.create.copper_ingot": "UNLOCALIZED: Copper Ingot", @@ -462,6 +464,7 @@ "item.create.handheld_blockzapper": "Blockpistole", "item.create.handheld_worldshaper": "Geländeformer", "item.create.honey_bucket": "Honigeimer", + "item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple", "item.create.integrated_circuit": "UNLOCALIZED: Integrated Circuit", "item.create.iron_sheet": "Eisenblech", "item.create.lapis_sheet": "UNLOCALIZED: Lapis Sheet", @@ -478,6 +481,7 @@ "item.create.schematic_and_quill": "Bauplan und Feder", "item.create.shadow_steel": "UNLOCALIZED: Shadow Steel", "item.create.super_glue": "Superkleber", + "item.create.sweet_roll": "UNLOCALIZED: Sweet Roll", "item.create.tree_fertilizer": "Baumdünger", "item.create.vertical_gearbox": "UNLOCALIZED: Vertical Gearbox", "item.create.wand_of_symmetry": "Symmetriestab", diff --git a/src/generated/resources/assets/create/lang/unfinished/es_es.json b/src/generated/resources/assets/create/lang/unfinished/es_es.json index ec6906b05..20acf0dd8 100644 --- a/src/generated/resources/assets/create/lang/unfinished/es_es.json +++ b/src/generated/resources/assets/create/lang/unfinished/es_es.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 27", + "_": "->------------------------] Game Elements [------------------------<-", @@ -376,6 +376,7 @@ "block.create.spout": "Surtidor", "block.create.spruce_window": "Ventana de abeto", "block.create.spruce_window_pane": "Panel de ventana de abeto", + "block.create.sticker": "UNLOCALIZED: Sticker", "block.create.sticky_mechanical_piston": "Pistón mecánico pegajoso", "block.create.stockpile_switch": "Interruptor de acopio", "block.create.stressometer": "Estresómetro", @@ -429,6 +430,7 @@ "item.create.builders_tea": "Té del Constructor", "item.create.chest_minecart_contraption": "Artilugio de vagoneta con cofre", "item.create.chocolate_bucket": "Cubo de chocolate", + "item.create.chocolate_glazed_berries": "UNLOCALIZED: Chocolate Glazed Berries", "item.create.chromatic_compound": "Compuesto cromático", "item.create.cinder_flour": "Harina de ceniza", "item.create.copper_ingot": "Lingote de cobre", @@ -462,6 +464,7 @@ "item.create.handheld_blockzapper": "Blockzapper", "item.create.handheld_worldshaper": "Worldshaper", "item.create.honey_bucket": "Cubo de miel", + "item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple", "item.create.integrated_circuit": "Chip de circuito integrado", "item.create.iron_sheet": "Lámina de hierro", "item.create.lapis_sheet": "Lámina de lapislázuli", @@ -478,6 +481,7 @@ "item.create.schematic_and_quill": "Esquema y Pluma", "item.create.shadow_steel": "Acero sombrío", "item.create.super_glue": "Super Pegamento", + "item.create.sweet_roll": "UNLOCALIZED: Sweet Roll", "item.create.tree_fertilizer": "Fertilizador de árboles", "item.create.vertical_gearbox": "Caja de transmisión vertical", "item.create.wand_of_symmetry": "Varita de simetría", diff --git a/src/generated/resources/assets/create/lang/unfinished/es_mx.json b/src/generated/resources/assets/create/lang/unfinished/es_mx.json index 84997734d..b8e2ed112 100644 --- a/src/generated/resources/assets/create/lang/unfinished/es_mx.json +++ b/src/generated/resources/assets/create/lang/unfinished/es_mx.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 915", + "_": "->------------------------] Game Elements [------------------------<-", @@ -376,6 +376,7 @@ "block.create.spout": "Canaleta", "block.create.spruce_window": "Ventana de Abeto", "block.create.spruce_window_pane": "Panel de Ventana de Abeto", + "block.create.sticker": "UNLOCALIZED: Sticker", "block.create.sticky_mechanical_piston": "Pistón Mecánico Pegajoso", "block.create.stockpile_switch": "Interruptor de Pila", "block.create.stressometer": "Estresómetro", @@ -429,6 +430,7 @@ "item.create.builders_tea": "Té del Constructor", "item.create.chest_minecart_contraption": "Artefacto de Vagón con Cofre", "item.create.chocolate_bucket": "Cubeta de Chocolate", + "item.create.chocolate_glazed_berries": "UNLOCALIZED: Chocolate Glazed Berries", "item.create.chromatic_compound": "Compuesto Cromático", "item.create.cinder_flour": "Ceniza Molida", "item.create.copper_ingot": "Lingote de Cobre", @@ -462,6 +464,7 @@ "item.create.handheld_blockzapper": "Pistola de Manipulación de Bloques", "item.create.handheld_worldshaper": "Pistola de Manipulación de Mundo", "item.create.honey_bucket": "Cubeta de Miel", + "item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple", "item.create.integrated_circuit": "Circuito Integrado", "item.create.iron_sheet": "Lámina de Hierro", "item.create.lapis_sheet": "Lámina de Lapislázuli", @@ -478,6 +481,7 @@ "item.create.schematic_and_quill": "Esquema y Pluma", "item.create.shadow_steel": "Acero Sombrío", "item.create.super_glue": "Super Pegamento", + "item.create.sweet_roll": "UNLOCALIZED: Sweet Roll", "item.create.tree_fertilizer": "Fertilizador de Árboles", "item.create.vertical_gearbox": "Transmisión Vertical", "item.create.wand_of_symmetry": "Vara de la Simetria", 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 f995e8539..67f324ccc 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: 697", + "_": "->------------------------] Game Elements [------------------------<-", @@ -376,6 +376,7 @@ "block.create.spout": "UNLOCALIZED: Spout", "block.create.spruce_window": "UNLOCALIZED: Spruce Window", "block.create.spruce_window_pane": "UNLOCALIZED: Spruce Window Pane", + "block.create.sticker": "UNLOCALIZED: Sticker", "block.create.sticky_mechanical_piston": "Piston mécanique collant", "block.create.stockpile_switch": "Détecteur de stockage", "block.create.stressometer": "Stressomètre", @@ -429,6 +430,7 @@ "item.create.builders_tea": "Thé du constructeur", "item.create.chest_minecart_contraption": "Engin de wagonnet avec coffre", "item.create.chocolate_bucket": "Seau de chocolat", + "item.create.chocolate_glazed_berries": "UNLOCALIZED: Chocolate Glazed Berries", "item.create.chromatic_compound": "Composé chromatique", "item.create.cinder_flour": "Farine de braise", "item.create.copper_ingot": "Lingot de cuivre", @@ -462,6 +464,7 @@ "item.create.handheld_blockzapper": "Blockzappeur portable", "item.create.handheld_worldshaper": "Térraformeur portable", "item.create.honey_bucket": "Seau de miel", + "item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple", "item.create.integrated_circuit": "Circuit intégré", "item.create.iron_sheet": "Plaque de Fer", "item.create.lapis_sheet": "Feuille de lapis", @@ -478,6 +481,7 @@ "item.create.schematic_and_quill": "Schéma et plume", "item.create.shadow_steel": "Acier sombre", "item.create.super_glue": "Colle extra-forte", + "item.create.sweet_roll": "UNLOCALIZED: Sweet Roll", "item.create.tree_fertilizer": "Engrais pour arbres", "item.create.vertical_gearbox": "Boîte de transfert verticale", "item.create.wand_of_symmetry": "Bâton de symétrie", 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 0969a4ee6..600ce86e4 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: 32", + "_": "->------------------------] Game Elements [------------------------<-", @@ -376,6 +376,7 @@ "block.create.spout": "Spruzzo", "block.create.spruce_window": "Finestra di abete", "block.create.spruce_window_pane": "Pannello di finestra di abete", + "block.create.sticker": "UNLOCALIZED: Sticker", "block.create.sticky_mechanical_piston": "Pistone meccanico appiccicoso", "block.create.stockpile_switch": "Interruttore accumulatore", "block.create.stressometer": "Stressometro", @@ -429,6 +430,7 @@ "item.create.builders_tea": "Tè del costruttore", "item.create.chest_minecart_contraption": "Contrazione per carrello da miniera con baule", "item.create.chocolate_bucket": "Secchio di cioccolata", + "item.create.chocolate_glazed_berries": "UNLOCALIZED: Chocolate Glazed Berries", "item.create.chromatic_compound": "Composto cromatico", "item.create.cinder_flour": "Cenere farinosa", "item.create.copper_ingot": "Lingotto di rame", @@ -462,6 +464,7 @@ "item.create.handheld_blockzapper": "Zapper di blocchi portatile", "item.create.handheld_worldshaper": "Plasmatore del mondo portatile", "item.create.honey_bucket": "Secchio di miele", + "item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple", "item.create.integrated_circuit": "Circuito integrato", "item.create.iron_sheet": "Lamiera di ferro", "item.create.lapis_sheet": "Lamiera di lapislazzuli", @@ -478,6 +481,7 @@ "item.create.schematic_and_quill": "Schematica e penna d'oca", "item.create.shadow_steel": "Acciaio oscuro", "item.create.super_glue": "Super colla", + "item.create.sweet_roll": "UNLOCALIZED: Sweet Roll", "item.create.tree_fertilizer": "Fertilizzante per alberi", "item.create.vertical_gearbox": "Riduttore verticale", "item.create.wand_of_symmetry": "Asta di simmetria", 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 19dad246e..8df1f5557 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: 39", + "_": "->------------------------] Game Elements [------------------------<-", @@ -376,6 +376,7 @@ "block.create.spout": "アイテム注液口", "block.create.spruce_window": "マツの窓", "block.create.spruce_window_pane": "マツの窓パネル", + "block.create.sticker": "UNLOCALIZED: Sticker", "block.create.sticky_mechanical_piston": "粘着メカニカルピストン", "block.create.stockpile_switch": "在庫スイッチ", "block.create.stressometer": "応力メーター", @@ -429,6 +430,7 @@ "item.create.builders_tea": "建築家のお茶", "item.create.chest_minecart_contraption": "からくりチェストトロッコ", "item.create.chocolate_bucket": "チョコレート入りバケツ", + "item.create.chocolate_glazed_berries": "UNLOCALIZED: Chocolate Glazed Berries", "item.create.chromatic_compound": "色彩の化合物", "item.create.cinder_flour": "ネザーラックの粉", "item.create.copper_ingot": "銅インゴット", @@ -462,6 +464,7 @@ "item.create.handheld_blockzapper": "携帯ブロックザッパー", "item.create.handheld_worldshaper": "携帯ワールドシェーパー", "item.create.honey_bucket": "ハチミツ入りバケツ", + "item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple", "item.create.integrated_circuit": "集積回路", "item.create.iron_sheet": "鉄板", "item.create.lapis_sheet": "ラピスラズリ板", @@ -478,6 +481,7 @@ "item.create.schematic_and_quill": "概略図と羽根ペン", "item.create.shadow_steel": "シャドウスチール", "item.create.super_glue": "接着剤", + "item.create.sweet_roll": "UNLOCALIZED: Sweet Roll", "item.create.tree_fertilizer": "樹木の肥料", "item.create.vertical_gearbox": "垂直ギアボックス", "item.create.wand_of_symmetry": "対称の杖", 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 e23ad6d39..8943e8fec 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: 86", + "_": "->------------------------] Game Elements [------------------------<-", @@ -376,6 +376,7 @@ "block.create.spout": "수도꼭지", "block.create.spruce_window": "가문비나무 유리창", "block.create.spruce_window_pane": "가문비나무 유리판", + "block.create.sticker": "UNLOCALIZED: Sticker", "block.create.sticky_mechanical_piston": "끈끈이 기계식 피스톤", "block.create.stockpile_switch": "수량 스위치", "block.create.stressometer": "피로도 계측기", @@ -429,6 +430,7 @@ "item.create.builders_tea": "건축가의 차", "item.create.chest_minecart_contraption": "상자가 실린 광산 수레 장치", "item.create.chocolate_bucket": "초콜릿 양동이", + "item.create.chocolate_glazed_berries": "UNLOCALIZED: Chocolate Glazed Berries", "item.create.chromatic_compound": "색채 혼합물", "item.create.cinder_flour": "잿가루", "item.create.copper_ingot": "구리 주괴", @@ -462,6 +464,7 @@ "item.create.handheld_blockzapper": "휴대용 블록발사기", "item.create.handheld_worldshaper": "휴대용 세계편집기", "item.create.honey_bucket": "꿀 양동이", + "item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple", "item.create.integrated_circuit": "집적 회로", "item.create.iron_sheet": "철 판", "item.create.lapis_sheet": "청금석 판", @@ -478,6 +481,7 @@ "item.create.schematic_and_quill": "청사진과 깃펜", "item.create.shadow_steel": "그림자 강철", "item.create.super_glue": "강력 접착제", + "item.create.sweet_roll": "UNLOCALIZED: Sweet Roll", "item.create.tree_fertilizer": "나무 비료", "item.create.vertical_gearbox": "수직 기어박스", "item.create.wand_of_symmetry": "대칭의 지팡이", 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 5cfefc828..0c9221797 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: 1184", + "_": "->------------------------] Game Elements [------------------------<-", @@ -376,6 +376,7 @@ "block.create.spout": "UNLOCALIZED: Spout", "block.create.spruce_window": "UNLOCALIZED: Spruce Window", "block.create.spruce_window_pane": "UNLOCALIZED: Spruce Window Pane", + "block.create.sticker": "UNLOCALIZED: Sticker", "block.create.sticky_mechanical_piston": "Mechanische Zuiger", "block.create.stockpile_switch": "Voorraad Schakelaar", "block.create.stressometer": "Stressmeter", @@ -429,6 +430,7 @@ "item.create.builders_tea": "UNLOCALIZED: Builder's Tea", "item.create.chest_minecart_contraption": "UNLOCALIZED: Chest Minecart Contraption", "item.create.chocolate_bucket": "UNLOCALIZED: Chocolate Bucket", + "item.create.chocolate_glazed_berries": "UNLOCALIZED: Chocolate Glazed Berries", "item.create.chromatic_compound": "UNLOCALIZED: Chromatic Compound", "item.create.cinder_flour": "UNLOCALIZED: Cinder Flour", "item.create.copper_ingot": "Koperstaaf", @@ -462,6 +464,7 @@ "item.create.handheld_blockzapper": "Blokzapper", "item.create.handheld_worldshaper": "UNLOCALIZED: Handheld Worldshaper", "item.create.honey_bucket": "UNLOCALIZED: Honey Bucket", + "item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple", "item.create.integrated_circuit": "UNLOCALIZED: Integrated Circuit", "item.create.iron_sheet": "IJzeren Platen", "item.create.lapis_sheet": "UNLOCALIZED: Lapis Sheet", @@ -478,6 +481,7 @@ "item.create.schematic_and_quill": "Bouwtekening en Veer", "item.create.shadow_steel": "UNLOCALIZED: Shadow Steel", "item.create.super_glue": "UNLOCALIZED: Super Glue", + "item.create.sweet_roll": "UNLOCALIZED: Sweet Roll", "item.create.tree_fertilizer": "Boom mest", "item.create.vertical_gearbox": "UNLOCALIZED: Vertical Gearbox", "item.create.wand_of_symmetry": "Symmetrie Staf", 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 63acab574..77de36ab7 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: 1250", + "_": "->------------------------] Game Elements [------------------------<-", @@ -376,6 +376,7 @@ "block.create.spout": "UNLOCALIZED: Spout", "block.create.spruce_window": "UNLOCALIZED: Spruce Window", "block.create.spruce_window_pane": "UNLOCALIZED: Spruce Window Pane", + "block.create.sticker": "UNLOCALIZED: Sticker", "block.create.sticky_mechanical_piston": "Pistão Mecânico Grudento", "block.create.stockpile_switch": "Disjuntor de Armazenamento", "block.create.stressometer": "UNLOCALIZED: Stressometer", @@ -429,6 +430,7 @@ "item.create.builders_tea": "UNLOCALIZED: Builder's Tea", "item.create.chest_minecart_contraption": "UNLOCALIZED: Chest Minecart Contraption", "item.create.chocolate_bucket": "UNLOCALIZED: Chocolate Bucket", + "item.create.chocolate_glazed_berries": "UNLOCALIZED: Chocolate Glazed Berries", "item.create.chromatic_compound": "UNLOCALIZED: Chromatic Compound", "item.create.cinder_flour": "UNLOCALIZED: Cinder Flour", "item.create.copper_ingot": "UNLOCALIZED: Copper Ingot", @@ -462,6 +464,7 @@ "item.create.handheld_blockzapper": "Blockzapper Portátil", "item.create.handheld_worldshaper": "UNLOCALIZED: Handheld Worldshaper", "item.create.honey_bucket": "UNLOCALIZED: Honey Bucket", + "item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple", "item.create.integrated_circuit": "UNLOCALIZED: Integrated Circuit", "item.create.iron_sheet": "Placas de Ferro", "item.create.lapis_sheet": "UNLOCALIZED: Lapis Sheet", @@ -478,6 +481,7 @@ "item.create.schematic_and_quill": "Esquema e pena", "item.create.shadow_steel": "UNLOCALIZED: Shadow Steel", "item.create.super_glue": "UNLOCALIZED: Super Glue", + "item.create.sweet_roll": "UNLOCALIZED: Sweet Roll", "item.create.tree_fertilizer": "Fertilizante de Árvore", "item.create.vertical_gearbox": "UNLOCALIZED: Vertical Gearbox", "item.create.wand_of_symmetry": "Varinha de Simetria", 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 e18e740a9..103a5c0e9 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: 36", + "_": "->------------------------] Game Elements [------------------------<-", @@ -376,6 +376,7 @@ "block.create.spout": "Дозатор", "block.create.spruce_window": "Еловое окно", "block.create.spruce_window_pane": "Панель из елового окна", + "block.create.sticker": "UNLOCALIZED: Sticker", "block.create.sticky_mechanical_piston": "Липкий механический поршень", "block.create.stockpile_switch": "Настраиваемый компаратор", "block.create.stressometer": "Динамометр", @@ -429,6 +430,7 @@ "item.create.builders_tea": "Чай Строителя", "item.create.chest_minecart_contraption": "Сундуко-вагонеточная штуковина", "item.create.chocolate_bucket": "Ведро шоколада", + "item.create.chocolate_glazed_berries": "UNLOCALIZED: Chocolate Glazed Berries", "item.create.chromatic_compound": "Хроматический компаунд", "item.create.cinder_flour": "Незераковая пыль", "item.create.copper_ingot": "Медный слиток", @@ -462,6 +464,7 @@ "item.create.handheld_blockzapper": "Ручная блоковая пушка", "item.create.handheld_worldshaper": "Ручной редактор мира", "item.create.honey_bucket": "Ведро мёда", + "item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple", "item.create.integrated_circuit": "Интегральная схема", "item.create.iron_sheet": "Железный лист", "item.create.lapis_sheet": "Лазуритовый лист", @@ -478,6 +481,7 @@ "item.create.schematic_and_quill": "Схематика и перо", "item.create.shadow_steel": "Призрачная сталь", "item.create.super_glue": "Супер-клей", + "item.create.sweet_roll": "UNLOCALIZED: Sweet Roll", "item.create.tree_fertilizer": "Удобрение для деревьев", "item.create.vertical_gearbox": "Вертикальная коробка передач", "item.create.wand_of_symmetry": "Жезл симметрии", 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 1fd05123d..7aa5b8ebe 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: 34", + "_": "->------------------------] Game Elements [------------------------<-", @@ -376,6 +376,7 @@ "block.create.spout": "注液器", "block.create.spruce_window": "云杉窗户", "block.create.spruce_window_pane": "云杉窗户板", + "block.create.sticker": "UNLOCALIZED: Sticker", "block.create.sticky_mechanical_piston": "黏性动力活塞", "block.create.stockpile_switch": "存量转换器", "block.create.stressometer": "应力表", @@ -429,6 +430,7 @@ "item.create.builders_tea": "建造工茶饮", "item.create.chest_minecart_contraption": "装配过的动力矿车", "item.create.chocolate_bucket": "巧克力桶", + "item.create.chocolate_glazed_berries": "UNLOCALIZED: Chocolate Glazed Berries", "item.create.chromatic_compound": "异彩化合物", "item.create.cinder_flour": "下界面粉", "item.create.copper_ingot": "铜锭", @@ -462,6 +464,7 @@ "item.create.handheld_blockzapper": "手持式方块放置器", "item.create.handheld_worldshaper": "手持式环境塑形器", "item.create.honey_bucket": "蜂蜜桶", + "item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple", "item.create.integrated_circuit": "集成电路板", "item.create.iron_sheet": "铁板", "item.create.lapis_sheet": "青金石板", @@ -478,6 +481,7 @@ "item.create.schematic_and_quill": "蓝图与笔", "item.create.shadow_steel": "暗影钢", "item.create.super_glue": "强力胶", + "item.create.sweet_roll": "UNLOCALIZED: Sweet Roll", "item.create.tree_fertilizer": "树木肥料", "item.create.vertical_gearbox": "竖直十字齿轮箱", "item.create.wand_of_symmetry": "对称之杖", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json index e5ec1a2c3..c680621aa 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 39", + "_": "->------------------------] Game Elements [------------------------<-", @@ -376,6 +376,7 @@ "block.create.spout": "液體灌注器", "block.create.spruce_window": "雲杉木窗戶", "block.create.spruce_window_pane": "雲杉木窗戶片", + "block.create.sticker": "UNLOCALIZED: Sticker", "block.create.sticky_mechanical_piston": "黏性機械活塞", "block.create.stockpile_switch": "存量檢測器", "block.create.stressometer": "動能錶", @@ -429,6 +430,7 @@ "item.create.builders_tea": "工人茶", "item.create.chest_minecart_contraption": "裝修過的機械礦車", "item.create.chocolate_bucket": "巧克力桶", + "item.create.chocolate_glazed_berries": "UNLOCALIZED: Chocolate Glazed Berries", "item.create.chromatic_compound": "異彩化合物", "item.create.cinder_flour": "地獄麵粉", "item.create.copper_ingot": "銅錠", @@ -462,6 +464,7 @@ "item.create.handheld_blockzapper": "方塊放置器", "item.create.handheld_worldshaper": "地形雕塑器", "item.create.honey_bucket": "蜂蜜桶", + "item.create.honeyed_apple": "UNLOCALIZED: Honeyed Apple", "item.create.integrated_circuit": "IC板", "item.create.iron_sheet": "鐵板", "item.create.lapis_sheet": "青金石板", @@ -478,6 +481,7 @@ "item.create.schematic_and_quill": "藍圖與筆", "item.create.shadow_steel": "暗影鋼", "item.create.super_glue": "強力膠", + "item.create.sweet_roll": "UNLOCALIZED: Sweet Roll", "item.create.tree_fertilizer": "樹木肥料", "item.create.vertical_gearbox": "豎直齒輪箱", "item.create.wand_of_symmetry": "對稱杖", diff --git a/src/generated/resources/assets/create/models/item/chocolate_glazed_berries.json b/src/generated/resources/assets/create/models/item/chocolate_glazed_berries.json new file mode 100644 index 000000000..d556cc478 --- /dev/null +++ b/src/generated/resources/assets/create/models/item/chocolate_glazed_berries.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "create:item/chocolate_glazed_berries" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/item/goggles.json b/src/generated/resources/assets/create/models/item/goggles.json new file mode 100644 index 000000000..0ae90a266 --- /dev/null +++ b/src/generated/resources/assets/create/models/item/goggles.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "create:item/goggles" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/item/honeyed_apple.json b/src/generated/resources/assets/create/models/item/honeyed_apple.json new file mode 100644 index 000000000..9940c5fab --- /dev/null +++ b/src/generated/resources/assets/create/models/item/honeyed_apple.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "create:item/honeyed_apple" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/item/sticker.json b/src/generated/resources/assets/create/models/item/sticker.json new file mode 100644 index 000000000..b1367cf86 --- /dev/null +++ b/src/generated/resources/assets/create/models/item/sticker.json @@ -0,0 +1,3 @@ +{ + "parent": "create:block/sticker/item" +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/models/item/sweet_roll.json b/src/generated/resources/assets/create/models/item/sweet_roll.json new file mode 100644 index 000000000..a7cb2e8f3 --- /dev/null +++ b/src/generated/resources/assets/create/models/item/sweet_roll.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "create:item/sweet_roll" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/create/advancements/recipes/create.base/crafting/kinetics/sticker.json b/src/generated/resources/data/create/advancements/recipes/create.base/crafting/kinetics/sticker.json new file mode 100644 index 000000000..65c58bb33 --- /dev/null +++ b/src/generated/resources/data/create/advancements/recipes/create.base/crafting/kinetics/sticker.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "create:crafting/kinetics/sticker" + ] + }, + "criteria": { + "has_item": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "create:andesite_alloy" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "create:crafting/kinetics/sticker" + } + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/loot_tables/blocks/sticker.json b/src/generated/resources/data/create/loot_tables/blocks/sticker.json new file mode 100644 index 000000000..92ccdbe64 --- /dev/null +++ b/src/generated/resources/data/create/loot_tables/blocks/sticker.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "create:sticker" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/recipes/crafting/kinetics/sticker.json b/src/generated/resources/data/create/recipes/crafting/kinetics/sticker.json new file mode 100644 index 000000000..71db9df8a --- /dev/null +++ b/src/generated/resources/data/create/recipes/crafting/kinetics/sticker.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "ISI", + "CRC" + ], + "key": { + "I": { + "item": "create:andesite_alloy" + }, + "C": { + "tag": "forge:cobblestone" + }, + "R": { + "tag": "forge:dusts/redstone" + }, + "S": { + "tag": "forge:slimeballs" + } + }, + "result": { + "item": "create:sticker" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/create/recipes/filling/chocolate_glazed_berries.json b/src/generated/resources/data/create/recipes/filling/chocolate_glazed_berries.json new file mode 100644 index 000000000..0ce5553a5 --- /dev/null +++ b/src/generated/resources/data/create/recipes/filling/chocolate_glazed_berries.json @@ -0,0 +1,18 @@ +{ + "type": "create:filling", + "ingredients": [ + { + "item": "minecraft:sweet_berries" + }, + { + "fluid": "create:chocolate", + "nbt": {}, + "amount": 250 + } + ], + "results": [ + { + "item": "create:chocolate_glazed_berries" + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/recipes/filling/honeyed_apple.json b/src/generated/resources/data/create/recipes/filling/honeyed_apple.json new file mode 100644 index 000000000..93692da87 --- /dev/null +++ b/src/generated/resources/data/create/recipes/filling/honeyed_apple.json @@ -0,0 +1,17 @@ +{ + "type": "create:filling", + "ingredients": [ + { + "item": "minecraft:apple" + }, + { + "fluidTag": "forge:honey", + "amount": 250 + } + ], + "results": [ + { + "item": "create:honeyed_apple" + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/recipes/filling/sweet_roll.json b/src/generated/resources/data/create/recipes/filling/sweet_roll.json new file mode 100644 index 000000000..b80ab581b --- /dev/null +++ b/src/generated/resources/data/create/recipes/filling/sweet_roll.json @@ -0,0 +1,17 @@ +{ + "type": "create:filling", + "ingredients": [ + { + "item": "minecraft:bread" + }, + { + "fluidTag": "forge:milk", + "amount": 250 + } + ], + "results": [ + { + "item": "create:sweet_roll" + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/create/tags/items/upright_on_belt.json b/src/generated/resources/data/create/tags/items/upright_on_belt.json index 83603f5b0..0aa3286d8 100644 --- a/src/generated/resources/data/create/tags/items/upright_on_belt.json +++ b/src/generated/resources/data/create/tags/items/upright_on_belt.json @@ -7,6 +7,7 @@ "minecraft:glass_bottle", "minecraft:potion", "minecraft:splash_potion", - "minecraft:lingering_potion" + "minecraft:lingering_potion", + "minecraft:honey_bottle" ] } \ 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 52641d2a9..727ecf78f 100644 --- a/src/main/java/com/simibubi/create/AllBlockPartials.java +++ b/src/main/java/com/simibubi/create/AllBlockPartials.java @@ -93,6 +93,8 @@ public class AllBlockPartials { SYMMETRY_PLANE = get("symmetry_effect/plane"), SYMMETRY_CROSSPLANE = get("symmetry_effect/crossplane"), SYMMETRY_TRIPLEPLANE = get("symmetry_effect/tripleplane"), + + STICKER_HEAD = get("sticker/head"), PORTABLE_STORAGE_INTERFACE_MIDDLE = get("portable_storage_interface/block_middle"), PORTABLE_STORAGE_INTERFACE_MIDDLE_POWERED = get("portable_storage_interface/block_middle_powered"), @@ -117,6 +119,8 @@ public class AllBlockPartials { SPEED_CONTROLLER_BRACKET = get("rotation_speed_controller/bracket"), + GOGGLES = get("goggles"), + COUPLING_ATTACHMENT = getEntity("minecart_coupling/attachment"), COUPLING_RING = getEntity("minecart_coupling/ring"), COUPLING_CONNECTOR = getEntity("minecart_coupling/connector") diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index aea45c42e..ac22dda0c 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -54,6 +54,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.bea import com.simibubi.create.content.contraptions.components.structureMovement.chassis.LinearChassisBlock; import com.simibubi.create.content.contraptions.components.structureMovement.chassis.LinearChassisBlock.ChassisCTBehaviour; import com.simibubi.create.content.contraptions.components.structureMovement.chassis.RadialChassisBlock; +import com.simibubi.create.content.contraptions.components.structureMovement.chassis.StickerBlock; import com.simibubi.create.content.contraptions.components.structureMovement.gantry.GantryPinionBlock; import com.simibubi.create.content.contraptions.components.structureMovement.mounted.CartAssemblerBlock; import com.simibubi.create.content.contraptions.components.structureMovement.mounted.CartAssemblerBlock.MinecartAnchorBlock; @@ -846,6 +847,15 @@ public class AllBlocks { .build() .register(); + public static final BlockEntry STICKER = REGISTRATE.block("sticker", StickerBlock::new) + .initialProperties(SharedProperties::stone) + .properties(Block.Properties::nonOpaque) + .addLayer(() -> RenderType::getCutoutMipped) + .blockstate((c, p) -> p.directionalBlock(c.get(), AssetLookup.forPowered(c, p))) + .item() + .transform(customItemModel()) + .register(); + public static final BlockEntry MECHANICAL_DRILL = REGISTRATE.block("mechanical_drill", DrillBlock::new) .initialProperties(SharedProperties::stone) .blockstate(BlockStateGen.directionalBlockProvider(true)) diff --git a/src/main/java/com/simibubi/create/AllEntityTypes.java b/src/main/java/com/simibubi/create/AllEntityTypes.java index d811fba0e..c92797f23 100644 --- a/src/main/java/com/simibubi/create/AllEntityTypes.java +++ b/src/main/java/com/simibubi/create/AllEntityTypes.java @@ -31,9 +31,9 @@ public class AllEntityTypes { contraption("gantry_contraption", GantryContraptionEntity::new, 10, 40, false); public static final RegistryEntry> SUPER_GLUE = register("super_glue", - SuperGlueEntity::new, EntityClassification.MISC, 10, Integer.MAX_VALUE, false, SuperGlueEntity::build); + SuperGlueEntity::new, EntityClassification.MISC, 10, Integer.MAX_VALUE, false, true, SuperGlueEntity::build); public static final RegistryEntry> SEAT = - register("seat", SeatEntity::new, EntityClassification.MISC, 0, Integer.MAX_VALUE, false, SeatEntity::build); + register("seat", SeatEntity::new, EntityClassification.MISC, 0, Integer.MAX_VALUE, false, true, SeatEntity::build); // @@ -41,12 +41,12 @@ public class AllEntityTypes { private static RegistryEntry> contraption(String name, IFactory factory, int range, int updateFrequency, boolean sendVelocity) { - return register(name, factory, EntityClassification.MISC, range, updateFrequency, sendVelocity, + return register(name, factory, EntityClassification.MISC, range, updateFrequency, sendVelocity, true, AbstractContraptionEntity::build); } private static RegistryEntry> register(String name, IFactory factory, - EntityClassification group, int range, int updateFrequency, boolean sendVelocity, + EntityClassification group, int range, int updateFrequency, boolean sendVelocity, boolean immuneToFire, NonNullConsumer> propertyBuilder) { String id = Lang.asId(name); return Create.registrate() @@ -55,6 +55,10 @@ public class AllEntityTypes { .setUpdateInterval(updateFrequency) .setShouldReceiveVelocityUpdates(sendVelocity)) .properties(propertyBuilder) + .properties(b -> { + if (immuneToFire) + b.immuneToFire(); + }) .register(); } diff --git a/src/main/java/com/simibubi/create/AllItems.java b/src/main/java/com/simibubi/create/AllItems.java index 292e50d91..698b61e36 100644 --- a/src/main/java/com/simibubi/create/AllItems.java +++ b/src/main/java/com/simibubi/create/AllItems.java @@ -16,6 +16,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.glu import com.simibubi.create.content.contraptions.components.structureMovement.mounted.MinecartContraptionItem; import com.simibubi.create.content.contraptions.components.structureMovement.train.MinecartCouplingItem; import com.simibubi.create.content.contraptions.goggles.GogglesItem; +import com.simibubi.create.content.contraptions.goggles.GogglesModel; import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlockItem; import com.simibubi.create.content.contraptions.relays.belt.item.BeltConnectorItem; import com.simibubi.create.content.contraptions.relays.gearbox.VerticalGearboxItem; @@ -117,6 +118,24 @@ public class AllItems { .lang("Bar of Chocolate") .register(); + public static final ItemEntry SWEET_ROLL = REGISTRATE.item("sweet_roll", Item::new) + .properties(p -> p.food(new Food.Builder().hunger(6) + .saturation(1.0F) + .build())) + .register(); + + public static final ItemEntry CHOCOLATE_BERRIES = REGISTRATE.item("chocolate_glazed_berries", Item::new) + .properties(p -> p.food(new Food.Builder().hunger(7) + .saturation(0.7F) + .build())) + .register(); + + public static final ItemEntry HONEYED_APPLE = REGISTRATE.item("honeyed_apple", Item::new) + .properties(p -> p.food(new Food.Builder().hunger(8) + .saturation(0.6F) + .build())) + .register(); + public static final ItemEntry BUILDERS_TEA = REGISTRATE.item("builders_tea", BuildersTeaItem::new) .tag(AllItemTags.UPRIGHT_ON_BELT.tag) .properties(p -> p.maxStackSize(16)) @@ -189,7 +208,7 @@ public class AllItems { public static final ItemEntry GOGGLES = REGISTRATE.item("goggles", GogglesItem::new) .properties(p -> p.maxStackSize(1)) - .model(AssetLookup.existingItemModel()) + .onRegister(CreateRegistrate.itemModel(() -> GogglesModel::new)) .lang("Engineer's Goggles") .register(); diff --git a/src/main/java/com/simibubi/create/AllTags.java b/src/main/java/com/simibubi/create/AllTags.java index 71bf7c9d2..f7ca2802d 100644 --- a/src/main/java/com/simibubi/create/AllTags.java +++ b/src/main/java/com/simibubi/create/AllTags.java @@ -176,7 +176,8 @@ public class AllTags { AllItemTags.CREATE_INGOTS.includeIn(AllItemTags.BEACON_PAYMENT); AllItemTags.CREATE_INGOTS.includeIn(AllItemTags.INGOTS); - AllItemTags.UPRIGHT_ON_BELT.add(Items.GLASS_BOTTLE, Items.POTION, Items.SPLASH_POTION, Items.LINGERING_POTION); + AllItemTags.UPRIGHT_ON_BELT.add(Items.GLASS_BOTTLE, Items.POTION, Items.SPLASH_POTION, Items.LINGERING_POTION, + Items.field_226638_pX_); AllBlockTags.WINDMILL_SAILS.includeAll(BlockTags.WOOL); diff --git a/src/main/java/com/simibubi/create/AllTileEntities.java b/src/main/java/com/simibubi/create/AllTileEntities.java index 1abb73271..5b0c1e96b 100644 --- a/src/main/java/com/simibubi/create/AllTileEntities.java +++ b/src/main/java/com/simibubi/create/AllTileEntities.java @@ -51,6 +51,8 @@ import com.simibubi.create.content.contraptions.components.structureMovement.bea import com.simibubi.create.content.contraptions.components.structureMovement.bearing.MechanicalBearingTileEntity; import com.simibubi.create.content.contraptions.components.structureMovement.bearing.WindmillBearingTileEntity; import com.simibubi.create.content.contraptions.components.structureMovement.chassis.ChassisTileEntity; +import com.simibubi.create.content.contraptions.components.structureMovement.chassis.StickerRenderer; +import com.simibubi.create.content.contraptions.components.structureMovement.chassis.StickerTileEntity; import com.simibubi.create.content.contraptions.components.structureMovement.gantry.GantryPinionRenderer; import com.simibubi.create.content.contraptions.components.structureMovement.gantry.GantryPinionTileEntity; import com.simibubi.create.content.contraptions.components.structureMovement.mounted.CartAssemblerTileEntity; @@ -104,6 +106,7 @@ import com.simibubi.create.content.contraptions.relays.gearbox.GearboxInstance; import com.simibubi.create.content.contraptions.relays.gearbox.GearboxRenderer; import com.simibubi.create.content.contraptions.relays.gearbox.GearboxTileEntity; import com.simibubi.create.content.contraptions.relays.gearbox.GearshiftTileEntity; +import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelInstance; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelRenderer; import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelTileEntity; import com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelTileEntity; @@ -116,6 +119,7 @@ import com.simibubi.create.content.logistics.block.depot.DepotTileEntity; import com.simibubi.create.content.logistics.block.diodes.AdjustablePulseRepeaterTileEntity; import com.simibubi.create.content.logistics.block.diodes.AdjustableRepeaterRenderer; import com.simibubi.create.content.logistics.block.diodes.AdjustableRepeaterTileEntity; +import com.simibubi.create.content.logistics.block.funnel.FunnelInstance; import com.simibubi.create.content.logistics.block.funnel.FunnelRenderer; import com.simibubi.create.content.logistics.block.funnel.FunnelTileEntity; import com.simibubi.create.content.logistics.block.inventories.AdjustableCrateTileEntity; @@ -339,12 +343,14 @@ public class AllTileEntities { .tileEntity("andesite_tunnel", BeltTunnelTileEntity::new) .validBlocks(AllBlocks.ANDESITE_TUNNEL) .renderer(() -> BeltTunnelRenderer::new) + .onRegister(BeltTunnelInstance::register) .register(); public static final TileEntityEntry BRASS_TUNNEL = Create.registrate() .tileEntity("brass_tunnel", BrassTunnelTileEntity::new) .validBlocks(AllBlocks.BRASS_TUNNEL) .renderer(() -> BeltTunnelRenderer::new) + .onRegister(BeltTunnelInstance::register) .register(); public static final TileEntityEntry MECHANICAL_ARM = Create.registrate() @@ -394,6 +400,12 @@ public class AllTileEntities { .validBlocks(AllBlocks.RADIAL_CHASSIS, AllBlocks.LINEAR_CHASSIS, AllBlocks.SECONDARY_LINEAR_CHASSIS) // .renderer(() -> renderer) .register(); + + public static final TileEntityEntry STICKER = Create.registrate() + .tileEntity("sticker", StickerTileEntity::new) + .validBlocks(AllBlocks.STICKER) + .renderer(() -> StickerRenderer::new) + .register(); public static final TileEntityEntry DRILL = Create.registrate() .tileEntity("drill", DrillTileEntity::new) @@ -591,6 +603,7 @@ public class AllTileEntities { .validBlocks(AllBlocks.BRASS_FUNNEL, AllBlocks.BRASS_BELT_FUNNEL, AllBlocks.ANDESITE_FUNNEL, AllBlocks.ANDESITE_BELT_FUNNEL) .renderer(() -> FunnelRenderer::new) + .onRegister(FunnelInstance::register) .register(); public static final TileEntityEntry CONTENT_OBSERVER = Create.registrate() diff --git a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedKinetics.java b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedKinetics.java index 2ff8f46ad..ef9e662ce 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedKinetics.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedKinetics.java @@ -12,7 +12,7 @@ import net.minecraft.util.Direction.Axis; public abstract class AnimatedKinetics implements IDrawable { public static float getCurrentAngle() { - return ((AnimationTickHolder.getRenderTick()) * 4f) % 360; + return ((AnimationTickHolder.getRenderTime()) * 4f) % 360; } protected BlockState shaft(Axis axis) { diff --git a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedMixer.java b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedMixer.java index a45e77ecd..2d3f78e12 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedMixer.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedMixer.java @@ -29,7 +29,7 @@ public class AnimatedMixer extends AnimatedKinetics { .scale(scale) .render(); - float animation = ((MathHelper.sin(AnimationTickHolder.getRenderTick() / 32f) + 1) / 5) + .5f; + float animation = ((MathHelper.sin(AnimationTickHolder.getRenderTime() / 32f) + 1) / 5) + .5f; GuiGameElement.of(AllBlockPartials.MECHANICAL_MIXER_POLE) .atLocal(0, animation, 0) diff --git a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedPress.java b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedPress.java index 849e95121..7cbf31cab 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedPress.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedPress.java @@ -48,7 +48,7 @@ public class AnimatedPress extends AnimatedKinetics { } private float getAnimatedHeadOffset() { - float cycle = (AnimationTickHolder.getRenderTick()) % 30; + float cycle = (AnimationTickHolder.getRenderTime()) % 30; if (cycle < 10) { float progress = cycle / 10; return -(progress * progress * progress); diff --git a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedSpout.java b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedSpout.java index d39255552..25db4f26a 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedSpout.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedSpout.java @@ -37,7 +37,7 @@ public class AnimatedSpout extends AnimatedKinetics { .scale(scale) .render(); - float cycle = AnimationTickHolder.getRenderTick() % 30; + float cycle = AnimationTickHolder.getRenderTime() % 30; float squeeze = cycle < 20 ? MathHelper.sin((float) (cycle / 20f * Math.PI)) : 0; squeeze *= 20; diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticRenderMaterials.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticRenderMaterials.java index 49223a3cb..8d3d32d31 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticRenderMaterials.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticRenderMaterials.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.base; import com.simibubi.create.content.contraptions.components.actors.ContraptionActorData; import com.simibubi.create.content.contraptions.relays.belt.BeltData; +import com.simibubi.create.content.logistics.block.FlapData; import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; import com.simibubi.create.foundation.render.backend.instancing.MaterialType; @@ -10,4 +11,6 @@ public class KineticRenderMaterials { public static final MaterialType> BELTS = new MaterialType<>(); public static final MaterialType> ACTORS = new MaterialType<>(); + + public static final MaterialType> FLAPS = new MaterialType<>(); } 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 088ce8618..d0ca45720 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 @@ -81,6 +81,9 @@ public abstract class KineticTileEntity extends SmartTileEntity } super.initialize(); + + if (world != null && world.isRemote) + DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> CreateClient.kineticRenderer.add(this)); } @Override @@ -534,13 +537,6 @@ public abstract class KineticTileEntity extends SmartTileEntity return block.hasIntegratedCogwheel(world, pos, state); } - @Override - public void onLoad() { - super.onLoad(); - if (world != null && world.isRemote) - DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> CreateClient.kineticRenderer.add(this)); - } - @Override public void onChunkUnloaded() { if (world != null && world.isRemote) 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 cc27ee7f8..f3814c3e3 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 @@ -58,7 +58,7 @@ public class KineticTileEntityRenderer extends SafeTileEntityRenderer ms.translate(0, isBlockItem ? 9 / 16f : 11 / 16f, 0); ms.scale(scale, scale, scale); transform = TransformType.GROUND; - ms.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(AnimationTickHolder.getRenderTick())); + ms.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(AnimationTickHolder.getRenderTime())); } else { float scale = punching ? .75f : isBlockItem ? .75f - 1 / 64f : .5f; @@ -176,7 +176,7 @@ public class DeployerRenderer extends SafeTileEntityRenderer double factor; if (context.contraption.stalled || context.position == null || context.data.contains("StationaryTimer")) { - factor = MathHelper.sin(AnimationTickHolder.getRenderTick() * .5f) * .25f + .25f; + factor = MathHelper.sin(AnimationTickHolder.getRenderTime() * .5f) * .25f + .25f; } else { Vec3d center = VecHelper.getCenterOf(new BlockPos(context.position)); double distance = context.position.distanceTo(center); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanRenderer.java index 5bf8b87d2..6421411d3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanRenderer.java @@ -41,7 +41,7 @@ public class EncasedFanRenderer extends KineticTileEntityRenderer { SuperByteBuffer fanInner = AllBlockPartials.ENCASED_FAN_INNER.renderOnDirectionalSouth(te.getBlockState(), direction.getOpposite()); - float time = AnimationTickHolder.getRenderTick(); + float time = AnimationTickHolder.getRenderTime(); float speed = te.getSpeed() * 5; if (speed > 0) speed = MathHelper.clamp(speed, 80, 64 * 20); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerRenderer.java index 4220afa17..134b7b788 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerRenderer.java @@ -45,7 +45,7 @@ public class MechanicalMixerRenderer extends KineticTileEntityRenderer { int packedLightmapCoords = WorldRenderer.getLightmapCoordinates(te.getWorld(), blockState, pos); float renderedHeadOffset = mixer.getRenderedHeadOffset(partialTicks); float speed = mixer.getRenderedHeadRotationSpeed(partialTicks); - float time = AnimationTickHolder.getRenderTick(); + float time = AnimationTickHolder.getRenderTime(); float angle = (float) (((time * speed * 6 / 10f) % 360) / 180 * (float) Math.PI); SuperByteBuffer poleRender = AllBlockPartials.MECHANICAL_MIXER_POLE.renderOn(blockState); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java index acd2b1625..5b8c56e0b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java @@ -649,4 +649,25 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit } + @Override + public void updateAquatics() { + /* + Override this with an empty method to reduce enormous calculation time when contraptions are in water + WARNING: THIS HAS A BUNCH OF SIDE EFFECTS! + - Fluids will not try to change contraption movement direction + - this.inWater and this.isInWater() will return unreliable data + - entities riding a contraption will not cause water splashes (seats are their own entity so this should be fine) + - fall distance is not reset when the contraption is in water + - this.eyesInWater and this.canSwim() will always be false + - swimming state will never be updated + */ + extinguish(); + } + + @Override + public void setFire(int p_70015_1_) { + // Contraptions no longer catch fire + } + + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementTraits.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementTraits.java index aaaef728b..c3566bad9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementTraits.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementTraits.java @@ -14,6 +14,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.bea import com.simibubi.create.content.contraptions.components.structureMovement.bearing.MechanicalBearingTileEntity; import com.simibubi.create.content.contraptions.components.structureMovement.bearing.SailBlock; import com.simibubi.create.content.contraptions.components.structureMovement.chassis.AbstractChassisBlock; +import com.simibubi.create.content.contraptions.components.structureMovement.chassis.StickerBlock; import com.simibubi.create.content.contraptions.components.structureMovement.mounted.CartAssemblerBlock; import com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock; import com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.PistonState; @@ -198,6 +199,10 @@ public class BlockMovementTraits { .getAxis(); if (state.getBlock() instanceof FluidTankBlock) return FluidTankConnectivityHandler.isConnected(world, pos, pos.offset(direction)); + if (AllBlocks.STICKER.has(state) && state.get(StickerBlock.EXTENDED)) { + return direction == state.get(StickerBlock.FACING) + && !notSupportive(world.getBlockState(pos.offset(direction)), direction.getOpposite()); + } return false; } @@ -231,6 +236,8 @@ public class BlockMovementTraits { if (AllBlocks.MECHANICAL_PISTON_HEAD.has(state)) return facing.getAxis() != state.get(BlockStateProperties.FACING) .getAxis(); + if (AllBlocks.STICKER.has(state) && !state.get(StickerBlock.EXTENDED)) + return facing == state.get(StickerBlock.FACING); return isBrittle(state); } 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 3e363d2d3..44fb1523c 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 @@ -8,7 +8,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects; @@ -34,6 +33,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.bea import com.simibubi.create.content.contraptions.components.structureMovement.bearing.StabilizedContraption; import com.simibubi.create.content.contraptions.components.structureMovement.chassis.AbstractChassisBlock; import com.simibubi.create.content.contraptions.components.structureMovement.chassis.ChassisTileEntity; +import com.simibubi.create.content.contraptions.components.structureMovement.chassis.StickerBlock; import com.simibubi.create.content.contraptions.components.structureMovement.gantry.GantryPinionBlock; import com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueEntity; import com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueHandler; @@ -57,6 +57,7 @@ import com.simibubi.create.foundation.utility.BlockFace; import com.simibubi.create.foundation.utility.Iterate; import com.simibubi.create.foundation.utility.NBTHelper; import com.simibubi.create.foundation.utility.NBTProcessors; +import com.simibubi.create.foundation.utility.UniqueLinkedList; import com.simibubi.create.foundation.utility.VecHelper; import com.simibubi.create.foundation.utility.worldWrappers.WrappedWorld; @@ -176,9 +177,10 @@ public abstract class Contraption { return contraption; } - public boolean searchMovedStructure(World world, BlockPos pos, @Nullable Direction forcedDirection) throws AssemblyException { + public boolean searchMovedStructure(World world, BlockPos pos, @Nullable Direction forcedDirection) + throws AssemblyException { initialPassengers.clear(); - Queue frontier = new LinkedList<>(); + Queue frontier = new UniqueLinkedList<>(); Set visited = new HashSet<>(); anchor = pos; @@ -297,6 +299,14 @@ public abstract class Contraption { if (AllBlocks.GANTRY_SHAFT.has(state)) moveGantryShaft(world, pos, frontier, visited, state); + if (AllBlocks.STICKER.has(state) && state.get(StickerBlock.EXTENDED)) { + Direction offset = state.get(StickerBlock.FACING); + BlockPos attached = pos.offset(offset); + if (!visited.contains(attached) + && !BlockMovementTraits.notSupportive(world.getBlockState(attached), offset.getOpposite())) + frontier.add(attached); + } + // Bearings potentially create stabilized sub-contraptions if (AllBlocks.MECHANICAL_BEARING.has(state)) moveBearing(pos, frontier, visited, state); @@ -352,7 +362,8 @@ public abstract class Contraption { boolean brittle = BlockMovementTraits.isBrittle(blockState); boolean canStick = !brittle && state.canStickTo(blockState) && blockState.canStickTo(state); if (canStick) { - if (state.getPushReaction() == PushReaction.PUSH_ONLY || blockState.getPushReaction() == PushReaction.PUSH_ONLY) { + if (state.getPushReaction() == PushReaction.PUSH_ONLY + || blockState.getPushReaction() == PushReaction.PUSH_ONLY) { canStick = false; } if (BlockMovementTraits.notSupportive(state, offset)) { @@ -363,7 +374,8 @@ public abstract class Contraption { } } - if (!wasVisited && (canStick || blockAttachedTowardsFace || faceHasGlue || (offset == forcedDirection && !BlockMovementTraits.notSupportive(state, forcedDirection)))) + if (!wasVisited && (canStick || blockAttachedTowardsFace || faceHasGlue + || (offset == forcedDirection && !BlockMovementTraits.notSupportive(state, forcedDirection)))) frontier.add(offsetPos); if (faceHasGlue) addGlue(superglue.get(offset)); @@ -503,7 +515,8 @@ public abstract class Contraption { } } - private boolean moveMechanicalPiston(World world, BlockPos pos, Queue frontier, Set visited, BlockState state) throws AssemblyException { + private boolean moveMechanicalPiston(World world, BlockPos pos, Queue frontier, Set visited, + BlockState state) throws AssemblyException { Direction direction = state.get(MechanicalPistonBlock.FACING); PistonState pistonState = state.get(MechanicalPistonBlock.STATE); if (pistonState == PistonState.MOVING) @@ -625,8 +638,9 @@ public abstract class Contraption { specialRenderedTileEntities.clear(); INBT blocks = nbt.get("Blocks"); - //used to differentiate between the 'old' and the paletted serialization - boolean usePalettedDeserialization = blocks != null && blocks.getId() == 10 && ((CompoundNBT) blocks).contains("Palette"); + // used to differentiate between the 'old' and the paletted serialization + boolean usePalettedDeserialization = + blocks != null && blocks.getId() == 10 && ((CompoundNBT) blocks).contains("Palette"); readBlocksCompound(blocks, world, usePalettedDeserialization); actors.clear(); @@ -712,16 +726,16 @@ public abstract class Contraption { } ListNBT superglueNBT = new ListNBT(); - for (Pair glueEntry : superglue) { - CompoundNBT c = new CompoundNBT(); - c.put("Pos", NBTUtil.writeBlockPos(glueEntry.getKey())); - c.putByte("Direction", (byte) glueEntry.getValue() - .getIndex()); - superglueNBT.add(c); - } - ListNBT storageNBT = new ListNBT(); if (!spawnPacket) { + for (Pair glueEntry : superglue) { + CompoundNBT c = new CompoundNBT(); + c.put("Pos", NBTUtil.writeBlockPos(glueEntry.getKey())); + c.putByte("Direction", (byte) glueEntry.getValue() + .getIndex()); + superglueNBT.add(c); + } + for (BlockPos pos : storage.keySet()) { CompoundNBT c = new CompoundNBT(); MountedStorage mountedStorage = storage.get(pos); @@ -778,7 +792,9 @@ public abstract class Contraption { private CompoundNBT writeBlocksCompound() { CompoundNBT compound = new CompoundNBT(); - PaletteHashMap palette = new PaletteHashMap<>(GameData.getBlockStateIDMap(), 16, (i, s) -> {throw new IllegalStateException("Palette Map index exceeded maximum");}, NBTUtil::readBlockState, NBTUtil::writeBlockState); + PaletteHashMap palette = new PaletteHashMap<>(GameData.getBlockStateIDMap(), 16, (i, s) -> { + throw new IllegalStateException("Palette Map index exceeded maximum"); + }, NBTUtil::readBlockState, NBTUtil::writeBlockState); ListNBT blockList = new ListNBT(); for (BlockInfo block : this.blocks.values()) { @@ -804,7 +820,9 @@ public abstract class Contraption { ListNBT blockList; if (usePalettedDeserialization) { CompoundNBT c = ((CompoundNBT) compound); - palette = new PaletteHashMap<>(GameData.getBlockStateIDMap(), 16, (i, s) -> {throw new IllegalStateException("Palette Map index exceeded maximum");}, NBTUtil::readBlockState, NBTUtil::writeBlockState); + palette = new PaletteHashMap<>(GameData.getBlockStateIDMap(), 16, (i, s) -> { + throw new IllegalStateException("Palette Map index exceeded maximum"); + }, NBTUtil::readBlockState, NBTUtil::writeBlockState); palette.read(c.getList("Palette", 10)); blockList = c.getList("BlockList", 10); @@ -862,19 +880,15 @@ public abstract class Contraption { } private static BlockInfo readBlockInfo(CompoundNBT blockListEntry, PaletteHashMap palette) { - return new BlockInfo( - BlockPos.fromLong(blockListEntry.getLong("Pos")), - Objects.requireNonNull(palette.get(blockListEntry.getInt("State"))), - blockListEntry.contains("Data") ? blockListEntry.getCompound("Data") : null - ); + return new BlockInfo(BlockPos.fromLong(blockListEntry.getLong("Pos")), + Objects.requireNonNull(palette.get(blockListEntry.getInt("State"))), + blockListEntry.contains("Data") ? blockListEntry.getCompound("Data") : null); } private static BlockInfo legacyReadBlockInfo(CompoundNBT blockListEntry) { - return new BlockInfo( - NBTUtil.readBlockPos(blockListEntry.getCompound("Pos")), - NBTUtil.readBlockState(blockListEntry.getCompound("Block")), - blockListEntry.contains("Data") ? blockListEntry.getCompound("Data") : null - ); + return new BlockInfo(NBTUtil.readBlockPos(blockListEntry.getCompound("Pos")), + NBTUtil.readBlockState(blockListEntry.getCompound("Block")), + blockListEntry.contains("Data") ? blockListEntry.getCompound("Data") : null); } public void removeBlocksFromWorld(World world, BlockPos offset) { @@ -902,7 +916,7 @@ public abstract class Contraption { world.getWorld() .removeTileEntity(add); int flags = BlockFlags.IS_MOVING | BlockFlags.NO_NEIGHBOR_DROPS | BlockFlags.UPDATE_NEIGHBORS - | BlockFlags.BLOCK_UPDATE; + | BlockFlags.BLOCK_UPDATE | BlockFlags.RERENDER_MAIN_THREAD; if (blockIn instanceof IWaterLoggable && oldState.has(BlockStateProperties.WATERLOGGED) && oldState.get(BlockStateProperties.WATERLOGGED) .booleanValue()) { 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 b66008c4e..f3d1f4b44 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 @@ -39,7 +39,7 @@ public class ContraptionEntityRenderer exte super.render(entity, yaw, partialTicks, ms, buffers, overlay); // Keep a copy of the transforms in order to determine correct lighting - MatrixStack msLocal = translateTo(entity, AnimationTickHolder.getRenderTick()); + MatrixStack msLocal = translateTo(entity, AnimationTickHolder.getPartialTicks()); MatrixStack[] matrixStacks = new MatrixStack[] { ms, msLocal }; ms.push(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingLighter.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingLighter.java index f2b3e5eec..ef4ab3bf4 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingLighter.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingLighter.java @@ -19,25 +19,13 @@ public class BearingLighter extends ContraptionLighter { Set blocks = contraption.getBlocks().keySet(); Direction orientation = contraption.facing; - - float maxDistanceSq = -1; - for (BlockPos pos : blocks) { - float x = pos.getX(); - float y = pos.getY(); - float z = pos.getZ(); - - float distSq = x * x + y * y + z * z; - - if (distSq > maxDistanceSq) maxDistanceSq = distSq; - } - - int radius = (int) (Math.ceil(Math.sqrt(maxDistanceSq))); - - GridAlignedBB betterBounds = GridAlignedBB.ofRadius(radius); - GridAlignedBB contraptionBounds = GridAlignedBB.fromAABB(contraption.bounds); - Direction.Axis axis = orientation.getAxis(); + int radius = (int) (Math.ceil(Math.sqrt(getRadius(blocks, axis)))); + + GridAlignedBB betterBounds = GridAlignedBB.ofRadius(radius); + + GridAlignedBB contraptionBounds = GridAlignedBB.fromAABB(contraption.bounds); if (axis == Direction.Axis.X) { betterBounds.maxX = contraptionBounds.maxX; betterBounds.minX = contraptionBounds.minX; @@ -52,4 +40,36 @@ public class BearingLighter extends ContraptionLighter { betterBounds.translate(contraption.anchor); return betterBounds; } + + private static float getRadius(Set blocks, Direction.Axis axis) { + switch (axis) { + case X: + return getMaxDistSqr(blocks, BlockPos::getY, BlockPos::getZ); + case Y: + return getMaxDistSqr(blocks, BlockPos::getX, BlockPos::getZ); + case Z: + return getMaxDistSqr(blocks, BlockPos::getX, BlockPos::getY); + } + + throw new IllegalStateException("Impossible axis"); + } + + private static float getMaxDistSqr(Set blocks, Coordinate one, Coordinate other) { + float maxDistSq = -1; + for (BlockPos pos : blocks) { + float a = one.get(pos); + float b = other.get(pos); + + float distSq = a * a + b * b; + + + if (distSq > maxDistSq) maxDistSq = distSq; + } + + return maxDistSq; + } + + private interface Coordinate { + float get(BlockPos from); + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerBlock.java new file mode 100644 index 000000000..74a3959a0 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerBlock.java @@ -0,0 +1,162 @@ +package com.simibubi.create.content.contraptions.components.structureMovement.chassis; + +import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllTileEntities; +import com.simibubi.create.foundation.block.ITE; +import com.simibubi.create.foundation.block.ProperDirectionalBlock; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.particles.BlockParticleData; +import net.minecraft.particles.ParticleTypes; +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.util.math.Vec3d; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.IWorldReader; +import net.minecraft.world.World; +import net.minecraft.world.server.ServerWorld; + +public class StickerBlock extends ProperDirectionalBlock implements ITE { + + public static final BooleanProperty POWERED = BlockStateProperties.POWERED; + public static final BooleanProperty EXTENDED = BlockStateProperties.EXTENDED; + + public StickerBlock(Properties p_i48415_1_) { + super(p_i48415_1_); + setDefaultState(getDefaultState().with(POWERED, false) + .with(EXTENDED, false)); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + Direction nearestLookingDirection = context.getNearestLookingDirection(); + boolean shouldPower = context.getWorld() + .isBlockPowered(context.getPos()); + Direction facing = context.getPlayer() != null && context.getPlayer() + .isSneaking() ? nearestLookingDirection : nearestLookingDirection.getOpposite(); + + return getDefaultState().with(FACING, facing) + .with(POWERED, shouldPower); + } + + @Override + protected void fillStateContainer(Builder builder) { + super.fillStateContainer(builder.add(POWERED, EXTENDED)); + } + + @Override + public void neighborChanged(BlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos, + boolean isMoving) { + if (worldIn.isRemote) + return; + + boolean previouslyPowered = state.get(POWERED); + if (previouslyPowered != worldIn.isBlockPowered(pos)) { + state = state.cycle(POWERED); + if (state.get(POWERED)) + state = state.cycle(EXTENDED); + worldIn.setBlockState(pos, state, 2); + } + } + + @Override + public boolean hasTileEntity(BlockState state) { + return true; + } + + @Override + public boolean shouldCheckWeakPower(BlockState state, IWorldReader world, BlockPos pos, Direction side) { + return false; + } + + @Override + public TileEntity createTileEntity(BlockState state, IBlockReader world) { + return AllTileEntities.STICKER.create(); + } + + @Override + public Class getTileEntityClass() { + return StickerTileEntity.class; + } + + // Slime block stuff + + private boolean isUprightSticker(IBlockReader world, BlockPos pos) { + BlockState blockState = world.getBlockState(pos); + return AllBlocks.STICKER.has(blockState) && blockState.get(FACING) == Direction.UP; + } + + @Override + public void onFallenUpon(World p_180658_1_, BlockPos p_180658_2_, Entity p_180658_3_, float p_180658_4_) { + if (!isUprightSticker(p_180658_1_, p_180658_2_) || p_180658_3_.bypassesLandingEffects()) { + super.onFallenUpon(p_180658_1_, p_180658_2_, p_180658_3_, p_180658_4_); + } else { + p_180658_3_.handleFallDamage(p_180658_4_, 0.0F); + } + } + + @Override + public void onLanded(IBlockReader p_176216_1_, Entity p_176216_2_) { + if (!isUprightSticker(p_176216_1_, p_176216_2_.getPosition() + .down()) || p_176216_2_.bypassesLandingEffects()) { + super.onLanded(p_176216_1_, p_176216_2_); + } else { + this.func_226946_a_(p_176216_2_); + } + } + + private void func_226946_a_(Entity p_226946_1_) { + Vec3d vec3d = p_226946_1_.getMotion(); + if (vec3d.y < 0.0D) { + double d0 = p_226946_1_ instanceof LivingEntity ? 1.0D : 0.8D; + p_226946_1_.setMotion(vec3d.x, -vec3d.y * d0, vec3d.z); + } + } + + @Override + public void onEntityWalk(World p_176199_1_, BlockPos p_176199_2_, Entity p_176199_3_) { + double d0 = Math.abs(p_176199_3_.getMotion().y); + if (d0 < 0.1D && !p_176199_3_.bypassesSteppingEffects() && isUprightSticker(p_176199_1_, p_176199_2_)) { + double d1 = 0.4D + d0 * 0.2D; + p_176199_3_.setMotion(p_176199_3_.getMotion() + .mul(d1, 1.0D, d1)); + } + super.onEntityWalk(p_176199_1_, p_176199_2_, p_176199_3_); + } + + @Override + public boolean addLandingEffects(BlockState state1, ServerWorld worldserver, BlockPos pos, BlockState state2, + LivingEntity entity, int numberOfParticles) { + if (isUprightSticker(worldserver, pos)) { + worldserver.spawnParticle(new BlockParticleData(ParticleTypes.BLOCK, Blocks.SLIME_BLOCK.getDefaultState()), + entity.getX(), entity.getY(), entity.getZ(), numberOfParticles, 0.0D, 0.0D, 0.0D, (double) 0.15F); + return true; + } + return super.addLandingEffects(state1, worldserver, pos, state2, entity, numberOfParticles); + } + + @Override + public boolean addRunningEffects(BlockState state, World world, BlockPos pos, Entity entity) { + if (state.get(FACING) == Direction.UP) { + Vec3d vec3d = entity.getMotion(); + world.addParticle( + new BlockParticleData(ParticleTypes.BLOCK, Blocks.SLIME_BLOCK.getDefaultState()).setPos(pos), + entity.getX() + ((double) world.rand.nextFloat() - 0.5D) * (double) entity.getWidth(), + entity.getY() + 0.1D, + entity.getZ() + ((double) world.rand.nextFloat() - 0.5D) * (double) entity.getWidth(), vec3d.x * -4.0D, + 1.5D, vec3d.z * -4.0D); + return true; + } + return super.addRunningEffects(state, world, pos, entity); + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerRenderer.java new file mode 100644 index 000000000..8e6ef665c --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerRenderer.java @@ -0,0 +1,48 @@ +package com.simibubi.create.content.contraptions.components.structureMovement.chassis; + +import com.mojang.blaze3d.matrix.MatrixStack; +import com.simibubi.create.AllBlockPartials; +import com.simibubi.create.foundation.render.SuperByteBuffer; +import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer; +import com.simibubi.create.foundation.utility.AngleHelper; +import com.simibubi.create.foundation.utility.AnimationTickHolder; +import com.simibubi.create.foundation.utility.MatrixStacker; + +import net.minecraft.block.BlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.IRenderTypeBuffer; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.util.Direction; + +public class StickerRenderer extends SafeTileEntityRenderer { + + public StickerRenderer(TileEntityRendererDispatcher dispatcher) { + super(dispatcher); + } + + @Override + protected void renderSafe(StickerTileEntity te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffer, + int light, int overlay) { + BlockState state = te.getBlockState(); + SuperByteBuffer head = AllBlockPartials.STICKER_HEAD.renderOn(state); + float offset = te.piston.getValue(AnimationTickHolder.getPartialTicks()); + + if (te.getWorld() != Minecraft.getInstance().world) + offset = state.get(StickerBlock.EXTENDED) ? 1 : 0; + + Direction facing = state.get(StickerBlock.FACING); + ms.push(); + MatrixStacker.of(ms) + .nudge(te.hashCode()) + .centre() + .rotateY(AngleHelper.horizontalAngle(facing)) + .rotateX(AngleHelper.verticalAngle(facing) + 90) + .unCentre(); + ms.translate(0, (offset * offset) * 4 / 16f, 0); + head.light(light) + .renderInto(ms, buffer.getBuffer(RenderType.getSolid())); + ms.pop(); + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerTileEntity.java new file mode 100644 index 000000000..b79977b04 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerTileEntity.java @@ -0,0 +1,94 @@ +package com.simibubi.create.content.contraptions.components.structureMovement.chassis; + +import java.util.List; + +import com.simibubi.create.AllBlocks; +import com.simibubi.create.AllSoundEvents; +import com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueEntity; +import com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueItem; +import com.simibubi.create.foundation.tileEntity.SmartTileEntity; +import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; +import com.simibubi.create.foundation.utility.LerpedFloat; +import com.simibubi.create.foundation.utility.LerpedFloat.Chaser; + +import net.minecraft.block.BlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.tileentity.TileEntityType; +import net.minecraft.util.Direction; +import net.minecraft.util.SoundCategory; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.fml.DistExecutor; + +public class StickerTileEntity extends SmartTileEntity { + + LerpedFloat piston; + boolean update; + + public StickerTileEntity(TileEntityType tileEntityTypeIn) { + super(tileEntityTypeIn); + piston = LerpedFloat.linear(); + update = false; + } + + @Override + public void addBehaviours(List behaviours) {} + + @Override + public void initialize() { + super.initialize(); + if (!world.isRemote) + return; + piston.startWithValue(isBlockStateExtended() ? 1 : 0); + } + + public boolean isBlockStateExtended() { + BlockState blockState = getBlockState(); + boolean extended = AllBlocks.STICKER.has(blockState) && blockState.get(StickerBlock.EXTENDED); + return extended; + } + + @Override + public void tick() { + super.tick(); + if (!world.isRemote) + return; + piston.tickChaser(); + + if (isAttachedToBlock() && piston.getValue(0) != piston.getValue() && piston.getValue() == 1) { + SuperGlueItem.spawnParticles(world, pos, getBlockState().get(StickerBlock.FACING), true); + DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> playSound(true)); + } + + if (!update) + return; + update = false; + int target = isBlockStateExtended() ? 1 : 0; + if (isAttachedToBlock() && target == 0 && piston.getChaseTarget() == 1) + DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> playSound(false)); + piston.chase(target, .4f, Chaser.LINEAR); + } + + public boolean isAttachedToBlock() { + BlockState blockState = getBlockState(); + if (!AllBlocks.STICKER.has(blockState)) + return false; + Direction direction = blockState.get(StickerBlock.FACING); + return SuperGlueEntity.isValidFace(world, pos.offset(direction), direction.getOpposite()); + } + + @Override + protected void read(CompoundNBT compound, boolean clientPacket) { + super.read(compound, clientPacket); + if (clientPacket) + update = true; + } + + @OnlyIn(Dist.CLIENT) + public void playSound(boolean attach) { + world.playSound(Minecraft.getInstance().player, pos, AllSoundEvents.SLIME_ADDED.get(), SoundCategory.BLOCKS, + 0.35F, attach ? 0.75F : 0.2f); + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryPinionRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryPinionRenderer.java index 7772d70de..df2d3b49b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryPinionRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryPinionRenderer.java @@ -72,7 +72,7 @@ public class GantryPinionRenderer extends KineticTileEntityRenderer { } public static float getAngleForTe(KineticTileEntity te, final BlockPos pos, Axis axis) { - float time = AnimationTickHolder.getRenderTick(); + float time = AnimationTickHolder.getRenderTime(); float offset = getRotationOffsetForPosition(te, pos, axis); return ((time * te.getSpeed() * 3f / 20 + offset) % 360) / 180 * (float) Math.PI; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionKineticRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionKineticRenderer.java index 6733cd22a..f5fe4a9b9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionKineticRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionKineticRenderer.java @@ -4,6 +4,7 @@ import com.simibubi.create.content.contraptions.base.KineticRenderMaterials; import com.simibubi.create.content.contraptions.base.RotatingInstancedModel; import com.simibubi.create.content.contraptions.components.actors.RotatingActorModel; import com.simibubi.create.content.contraptions.relays.belt.BeltInstancedModel; +import com.simibubi.create.content.logistics.block.FlapInstancedModel; import com.simibubi.create.foundation.render.AllProgramSpecs; import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; import com.simibubi.create.foundation.render.backend.instancing.RenderMaterial; @@ -16,6 +17,7 @@ public class ContraptionKineticRenderer extends InstancedTileRenderer(this, AllProgramSpecs.CONTRAPTION_BELT, BeltInstancedModel::new)); materials.put(KineticRenderMaterials.ROTATING, new RenderMaterial<>(this, AllProgramSpecs.CONTRAPTION_ROTATING, RotatingInstancedModel::new)); + materials.put(KineticRenderMaterials.FLAPS, new RenderMaterial<>(this, AllProgramSpecs.CONTRAPTION_FLAPS, FlapInstancedModel::new)); materials.put(KineticRenderMaterials.ACTORS, new RenderMaterial<>(this, AllProgramSpecs.CONTRAPTION_ACTOR, RotatingActorModel::new)); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionModel.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionModel.java index c5bb45e7b..27d097aeb 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionModel.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionModel.java @@ -3,20 +3,69 @@ package com.simibubi.create.content.contraptions.components.structureMovement.re import java.nio.ByteBuffer; import com.simibubi.create.foundation.render.backend.BufferedModel; +import com.simibubi.create.foundation.render.backend.gl.GlBuffer; +import com.simibubi.create.foundation.render.backend.gl.GlPrimitiveType; import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.LightTexture; +import org.lwjgl.opengl.GL15; +import org.lwjgl.opengl.GL20; public class ContraptionModel extends BufferedModel { public static final VertexFormat FORMAT = VertexFormat.builder() .addAttributes(ContraptionVertexAttributes.class) .build(); + protected GlPrimitiveType eboIndexType; + protected GlBuffer ebo; + public ContraptionModel(BufferBuilder buf) { super(buf); } + @Override + protected void init() { + super.init(); + + createEBO(); + } + + @Override + protected void doRender() { + modelVBO.bind(); + ebo.bind(); + + setupAttributes(); + GL20.glDrawElements(GL20.GL_QUADS, vertexCount, eboIndexType.getGlConstant(), 0); + + int numAttributes = getTotalShaderAttributeCount(); + for (int i = 0; i <= numAttributes; i++) { + GL20.glDisableVertexAttribArray(i); + } + + ebo.unbind(); + modelVBO.unbind(); + } + + protected final void createEBO() { + ebo = new GlBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER); + eboIndexType = GlPrimitiveType.UINT; // TODO: choose this based on the number of vertices + + int indicesSize = vertexCount * eboIndexType.getSize(); + + ebo.bind(); + + GL15.glBufferData(GL15.GL_ELEMENT_ARRAY_BUFFER, indicesSize, GL15.GL_STATIC_DRAW); + ebo.map(indicesSize, indices -> { + for (int i = 0; i < vertexCount; i++) { + indices.putInt(i); + } + }); + + ebo.unbind(); + } + @Override protected void copyVertex(ByteBuffer to, int vertex) { to.putFloat(getX(template, vertex)); @@ -48,4 +97,10 @@ public class ContraptionModel extends BufferedModel { protected VertexFormat getModelFormat() { return FORMAT; } + + @Override + protected void deleteInternal() { + super.deleteInternal(); + ebo.delete(); + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java index f26e5174b..346c3e244 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java @@ -64,6 +64,12 @@ public class ContraptionRenderDispatcher { } } + public static void notifyLightPacket(ILightReader world, int chunkX, int chunkZ) { + for (RenderedContraption renderer : renderers.values()) { + renderer.getLighter().lightVolume.notifyLightPacket(world, chunkX, chunkZ); + } + } + public static void renderTick() { firstLayer = true; } @@ -98,20 +104,17 @@ public class ContraptionRenderDispatcher { return contraption; } + public static void beginFrame(double camX, double camY, double camZ) { + for (RenderedContraption renderer : renderers.values()) { + renderer.beginFrame(camX, camY, camZ); + } + } + public static void renderLayer(RenderType layer, Matrix4f viewProjection, double camX, double camY, double camZ) { removeDeadContraptions(); if (renderers.isEmpty()) return; - if (firstLayer) { - - for (RenderedContraption renderer : renderers.values()) { - renderer.beginFrame(camX, camY, camZ); - } - - firstLayer = false; - } - layer.startDrawing(); GL11.glEnable(GL13.GL_TEXTURE_3D); GL13.glActiveTexture(GL40.GL_TEXTURE4); // the shaders expect light volumes to be in texture 4 diff --git a/src/main/java/com/simibubi/create/content/contraptions/goggles/GogglesModel.java b/src/main/java/com/simibubi/create/content/contraptions/goggles/GogglesModel.java new file mode 100644 index 000000000..333f65bbd --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/goggles/GogglesModel.java @@ -0,0 +1,24 @@ +package com.simibubi.create.content.contraptions.goggles; + +import com.mojang.blaze3d.matrix.MatrixStack; +import com.simibubi.create.AllBlockPartials; +import com.simibubi.create.foundation.block.render.WrappedBakedModel; + +import net.minecraft.client.renderer.model.IBakedModel; +import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; + +public class GogglesModel extends WrappedBakedModel { + + public GogglesModel(IBakedModel template) { + super(template); + } + + @Override + public IBakedModel handlePerspective(TransformType cameraTransformType, MatrixStack mat) { + if (cameraTransformType == TransformType.HEAD) + return AllBlockPartials.GOGGLES.get() + .handlePerspective(cameraTransformType, mat); + return super.handlePerspective(cameraTransformType, mat); + } + +} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinRenderer.java index e05fb6ee0..618816da2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinRenderer.java @@ -72,7 +72,7 @@ public class BasinRenderer extends SmartTileEntityRenderer { if (fluidLevel > 0) { ms.translate(0, - (MathHelper.sin(AnimationTickHolder.getRenderTick() / 12f + anglePartition * itemCount) + 1.5f) * 1 + (MathHelper.sin(AnimationTickHolder.getRenderTime() / 12f + anglePartition * itemCount) + 1.5f) * 1 / 32f, 0); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingInventory.java b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingInventory.java index 4e2a4d77f..45cb0927b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingInventory.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingInventory.java @@ -55,6 +55,8 @@ public class ProcessingInventory extends ItemStackHandler { recipeDuration = nbt.getFloat("RecipeTime"); appliedRecipe = nbt.getBoolean("AppliedRecipe"); super.deserializeNBT(nbt); + if(isEmpty()) + appliedRecipe = false; } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerRenderer.java index a2b7abd5c..458035ec9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerRenderer.java @@ -27,7 +27,7 @@ public class BlazeBurnerRenderer extends SafeTileEntityRenderer { MatrixStacker msr = MatrixStacker.of(ms); IVertexBuilder vb = buffer.getBuffer(RenderType.getSolid()); - float renderTick = AnimationTickHolder.getRenderTick(); + float renderTick = AnimationTickHolder.getRenderTime(); ms.push(); msr.centre(); 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 a55c23825..f26ebceed 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 @@ -521,7 +521,7 @@ public class BeltTileEntity extends KineticTileEntity { @Override public boolean shouldRenderAsTE() { - return isController(); + return BeltBlock.canTransportObjects(getBlockState()); } private void updateLight() { diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftRenderer.java index 8aca8cccd..1d4531a36 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftRenderer.java @@ -32,7 +32,7 @@ public class SplitShaftRenderer extends KineticTileEntityRenderer { Block block = te.getBlockState().getBlock(); final Axis boxAxis = ((IRotate) block).getRotationAxis(te.getBlockState()); final BlockPos pos = te.getPos(); - float time = AnimationTickHolder.getRenderTick(); + float time = AnimationTickHolder.getRenderTime(); for (Direction direction : Iterate.directions) { Axis axis = direction.getAxis(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxRenderer.java index bd74bcdf8..601aedc49 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxRenderer.java @@ -30,7 +30,7 @@ public class GearboxRenderer extends KineticTileEntityRenderer { final Axis boxAxis = te.getBlockState().get(BlockStateProperties.AXIS); final BlockPos pos = te.getPos(); - float time = AnimationTickHolder.getRenderTick(); + float time = AnimationTickHolder.getRenderTime(); for (Direction direction : Iterate.directions) { final Axis axis = direction.getAxis(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/wrench/WrenchItemRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/wrench/WrenchItemRenderer.java index fc0828078..03cc04bdf 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/wrench/WrenchItemRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/wrench/WrenchItemRenderer.java @@ -16,7 +16,7 @@ public class WrenchItemRenderer extends CustomRenderedItemModelRenderer owner) { + super(owner); + } + + public FlapData setPosition(BlockPos pos) { + return setPosition(pos.getX(), pos.getY(), pos.getZ()); + } + + public FlapData setPosition(Vector3f pos) { + return setPosition(pos.getX(), pos.getY(), pos.getZ()); + } + + public FlapData setPosition(int x, int y, int z) { + BlockPos origin = owner.renderer.getOriginCoordinate(); + + return setPosition((float) (x - origin.getX()), + (float) (y - origin.getY()), + (float) (z - origin.getZ())); + } + + public FlapData setPosition(float x, float y, float z) { + this.x = x; + this.y = y; + this.z = z; + return this; + } + + public FlapData setBlockLight(int blockLight) { + this.blockLight = (byte) ((blockLight & 0xF) << 4); + return this; + } + + public FlapData setSkyLight(int skyLight) { + this.skyLight = (byte) ((skyLight & 0xF) << 4); + return this; + } + + public FlapData setSegmentOffset(float x, float y, float z) { + this.segmentOffsetX = x; + this.segmentOffsetY = y; + this.segmentOffsetZ = z; + return this; + } + + public FlapData setIntensity(float intensity) { + this.intensity = intensity; + return this; + } + + public FlapData setHorizontalAngle(float horizontalAngle) { + this.horizontalAngle = horizontalAngle; + return this; + } + + public FlapData setFlapScale(float flapScale) { + this.flapScale = flapScale; + return this; + } + + public FlapData setFlapness(float flapness) { + this.flapness = flapness; + return this; + } + + public FlapData setPivotVoxelSpace(float x, float y, float z) { + pivotX = x / 16f; + pivotY = y / 16f; + pivotZ = z / 16f; + return this; + } + + @Override + public void write(ByteBuffer buf) { + putVec3(buf, x, y, z); + putVec2(buf, blockLight, skyLight); + + putVec3(buf, segmentOffsetX, segmentOffsetY, segmentOffsetZ); + putVec3(buf, pivotX, pivotY, pivotZ); + + put(buf, horizontalAngle); + put(buf, intensity); + put(buf, flapScale); + + put(buf, flapness); + } +} diff --git a/src/main/java/com/simibubi/create/content/logistics/block/FlapInstancedModel.java b/src/main/java/com/simibubi/create/content/logistics/block/FlapInstancedModel.java new file mode 100644 index 000000000..d9502bb4d --- /dev/null +++ b/src/main/java/com/simibubi/create/content/logistics/block/FlapInstancedModel.java @@ -0,0 +1,22 @@ +package com.simibubi.create.content.logistics.block; + +import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat; +import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import net.minecraft.client.renderer.BufferBuilder; + +public class FlapInstancedModel extends InstancedModel { + public FlapInstancedModel(InstancedTileRenderer renderer, BufferBuilder buf) { + super(renderer, buf); + } + + @Override + protected FlapData newInstance() { + return new FlapData(this); + } + + @Override + protected VertexFormat getInstanceFormat() { + return FlapData.FORMAT; + } +} diff --git a/src/main/java/com/simibubi/create/content/logistics/block/FlapVertexAttributes.java b/src/main/java/com/simibubi/create/content/logistics/block/FlapVertexAttributes.java new file mode 100644 index 000000000..d32768a3f --- /dev/null +++ b/src/main/java/com/simibubi/create/content/logistics/block/FlapVertexAttributes.java @@ -0,0 +1,45 @@ +package com.simibubi.create.content.logistics.block; + +import com.simibubi.create.foundation.render.backend.gl.attrib.CommonAttributes; +import com.simibubi.create.foundation.render.backend.gl.attrib.IVertexAttrib; +import com.simibubi.create.foundation.render.backend.gl.attrib.VertexAttribSpec; + +public enum FlapVertexAttributes implements IVertexAttrib { + INSTANCE_POSITION("aInstancePos",CommonAttributes.VEC3), + LIGHT("aLight", CommonAttributes.LIGHT), + SEGMENT_OFFSET("aSegmentOffset", CommonAttributes.VEC3), + PIVOT("aPivot", CommonAttributes.VEC3), + HORIZONTAL_ANGLE("aHorizontalAngle", CommonAttributes.FLOAT), + INTENSITY("aIntensity", CommonAttributes.FLOAT), + FLAP_SCALE("aFlapScale", CommonAttributes.FLOAT), + FLAPNESS("aFlapness", CommonAttributes.FLOAT), + ; + + private final String name; + private final VertexAttribSpec spec; + + FlapVertexAttributes(String name, VertexAttribSpec spec) { + this.name = name; + this.spec = spec; + } + + @Override + public String attribName() { + return name; + } + + @Override + public VertexAttribSpec attribSpec() { + return spec; + } + + @Override + public int getDivisor() { + return 1; + } + + @Override + public int getBufferIndex() { + return 1; + } +} diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelInstance.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelInstance.java new file mode 100644 index 000000000..654bea79b --- /dev/null +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelInstance.java @@ -0,0 +1,106 @@ +package com.simibubi.create.content.logistics.block.belts.tunnel; + +import com.simibubi.create.AllBlockPartials; +import com.simibubi.create.content.contraptions.base.KineticRenderMaterials; +import com.simibubi.create.content.logistics.block.FlapData; +import com.simibubi.create.foundation.render.backend.instancing.*; +import com.simibubi.create.foundation.utility.AnimationTickHolder; +import net.minecraft.tileentity.TileEntityType; +import net.minecraft.util.Direction; +import net.minecraft.world.LightType; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.fml.DistExecutor; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.EnumMap; +import java.util.Map; + +public class BeltTunnelInstance extends TileEntityInstance implements ITickableInstance { + public static void register(TileEntityType type) { + DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> + InstancedTileRenderRegistry.instance.register(type, BeltTunnelInstance::new)); + } + + private Map>> tunnelFlaps; + + public BeltTunnelInstance(InstancedTileRenderer modelManager, BeltTunnelTileEntity tile) { + super(modelManager, tile); + } + + @Override + protected void init() { + tunnelFlaps = new EnumMap<>(Direction.class); + + InstancedModel model = modelManager.getMaterial(KineticRenderMaterials.FLAPS) + .getModel(AllBlockPartials.BELT_TUNNEL_FLAP, lastState); + + int blockLight = world.getLightLevel(LightType.BLOCK, pos); + int skyLight = world.getLightLevel(LightType.SKY, pos); + + tile.flaps.forEach((direction, flapValue) -> { + + float flapness = flapValue.get(AnimationTickHolder.getPartialTicks()); + + float horizontalAngle = direction.getOpposite().getHorizontalAngle(); + + float flapScale = direction.getAxis() == Direction.Axis.X ? 1 : -1; + + ArrayList> flaps = new ArrayList<>(4); + + for (int segment = 0; segment <= 3; segment++) { + float intensity = segment == 3 ? 1.5f : segment + 1; + float segmentOffset = -3 / 16f * segment; + + flaps.add(model.setupInstance(flapData -> { + flapData.setPosition(pos) + .setSegmentOffset(segmentOffset, 0, 0) + .setBlockLight(blockLight) + .setSkyLight(skyLight) + .setHorizontalAngle(horizontalAngle) + .setFlapness(flapness) + .setFlapScale(flapScale) + .setPivotVoxelSpace(0, 10, 1) + .setIntensity(intensity); + })); + } + + tunnelFlaps.put(direction, flaps); + }); + } + + @Override + public void tick() { + tunnelFlaps.forEach((direction, keys) -> { + + float flapness = tile.flaps.get(direction).get(AnimationTickHolder.getPartialTicks()); + for (InstanceKey key : keys) { + key.modifyInstance(data -> data.setFlapness(flapness)); + } + }); + } + + @Override + protected void onUpdate() { } + + @Override + public void updateLight() { + int blockLight = world.getLightLevel(LightType.BLOCK, pos); + int skyLight = world.getLightLevel(LightType.SKY, pos); + + for (ArrayList> instanceKeys : tunnelFlaps.values()) { + for (InstanceKey it : instanceKeys) { + it.modifyInstance(data -> data.setBlockLight(blockLight) + .setSkyLight(skyLight)); + } + } + } + + @Override + public void remove() { + tunnelFlaps.values() + .stream() + .flatMap(Collection::stream) + .forEach(InstanceKey::delete); + } +} diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelRenderer.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelRenderer.java index 8751cf110..b605298bf 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelRenderer.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelRenderer.java @@ -4,6 +4,8 @@ import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.foundation.render.SuperByteBuffer; +import com.simibubi.create.foundation.render.backend.Backend; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer; import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.Iterate; @@ -28,6 +30,9 @@ public class BeltTunnelRenderer extends SmartTileEntityRenderer flaps; + public Map flaps; public Set sides; protected LazyOptional cap = LazyOptional.empty(); @@ -43,7 +43,7 @@ public class BeltTunnelTileEntity extends SmartTileEntity { public BeltTunnelTileEntity(TileEntityType type) { super(type); - flaps = new HashMap<>(); + flaps = new EnumMap<>(Direction.class); sides = new HashSet<>(); flapsToSend = new LinkedList<>(); } @@ -174,7 +174,9 @@ public class BeltTunnelTileEntity extends SmartTileEntity { @Override public void initialize() { super.initialize(); -// updateTunnelConnections(); + updateTunnelConnections(); + if (world != null && world.isRemote) + DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> CreateClient.kineticRenderer.add(this)); } @Override @@ -212,4 +214,8 @@ public class BeltTunnelTileEntity extends SmartTileEntity { return this.cap.cast(); } + @Override + public void onChunkLightUpdate() { + CreateClient.kineticRenderer.onLightUpdate(this); + } } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelInstance.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelInstance.java new file mode 100644 index 000000000..b91a5b37f --- /dev/null +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelInstance.java @@ -0,0 +1,93 @@ +package com.simibubi.create.content.logistics.block.funnel; + +import com.simibubi.create.AllBlockPartials; +import com.simibubi.create.content.contraptions.base.KineticRenderMaterials; +import com.simibubi.create.content.logistics.block.FlapData; +import com.simibubi.create.foundation.render.backend.instancing.*; +import com.simibubi.create.foundation.utility.AnimationTickHolder; +import net.minecraft.tileentity.TileEntityType; +import net.minecraft.util.Direction; +import net.minecraft.world.LightType; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.fml.DistExecutor; + +import java.util.ArrayList; + +public class FunnelInstance extends TileEntityInstance implements ITickableInstance { + public static void register(TileEntityType type) { + DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> + InstancedTileRenderRegistry.instance.register(type, FunnelInstance::new)); + } + + private ArrayList> flaps; + + public FunnelInstance(InstancedTileRenderer modelManager, FunnelTileEntity tile) { + super(modelManager, tile); + } + + @Override + protected void init() { + flaps = new ArrayList<>(4); + + if (!tile.hasFlap()) return; + + AllBlockPartials flapPartial = (lastState.getBlock() instanceof FunnelBlock ? AllBlockPartials.FUNNEL_FLAP + : AllBlockPartials.BELT_FUNNEL_FLAP); + InstancedModel model = modelManager.getMaterial(KineticRenderMaterials.FLAPS) + .getModel(flapPartial, lastState); + + int blockLight = world.getLightLevel(LightType.BLOCK, pos); + int skyLight = world.getLightLevel(LightType.SKY, pos); + + Direction direction = FunnelBlock.getFunnelFacing(lastState); + + float flapness = tile.flap.get(AnimationTickHolder.getPartialTicks()); + float horizontalAngle = direction.getOpposite().getHorizontalAngle(); + + for (int segment = 0; segment <= 3; segment++) { + float intensity = segment == 3 ? 1.5f : segment + 1; + float segmentOffset = -3 / 16f * segment; + + flaps.add(model.setupInstance(flapData -> flapData.setPosition(pos) + .setSegmentOffset(segmentOffset, 0, -tile.getFlapOffset()) + .setBlockLight(blockLight) + .setSkyLight(skyLight) + .setHorizontalAngle(horizontalAngle) + .setFlapness(flapness) + .setFlapScale(-1) + .setPivotVoxelSpace(0, 10, 9.5f) + .setIntensity(intensity))); + } + } + + @Override + public void tick() { + if (flaps == null) return; + + float flapness = tile.flap.get(AnimationTickHolder.getPartialTicks()); + + for (InstanceKey key : flaps) { + key.modifyInstance(data -> data.setFlapness(flapness)); + } + } + + @Override + public void updateLight() { + if (flaps == null) return; + + int blockLight = world.getLightLevel(LightType.BLOCK, pos); + int skyLight = world.getLightLevel(LightType.SKY, pos); + + for (InstanceKey it : flaps) { + it.modifyInstance(data -> data.setBlockLight(blockLight) + .setSkyLight(skyLight)); + } + } + + @Override + public void remove() { + if (flaps == null) return; + + flaps.forEach(InstanceKey::delete); + } +} diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelRenderer.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelRenderer.java index c8cb12583..0f2ea623a 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelRenderer.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelRenderer.java @@ -4,6 +4,7 @@ import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.foundation.render.SuperByteBuffer; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer; import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.MatrixStacker; @@ -27,7 +28,7 @@ public class FunnelRenderer extends SmartTileEntityRenderer { int light, int overlay) { super.renderSafe(te, partialTicks, ms, buffer, light, overlay); - if (!te.hasFlap()) + if (!te.hasFlap() || FastRenderDispatcher.available(te.getWorld())) return; BlockState blockState = te.getBlockState(); 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 a25b196cb..c2d8f3893 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 @@ -4,6 +4,7 @@ import java.lang.ref.WeakReference; import java.util.List; import com.simibubi.create.AllBlocks; +import com.simibubi.create.CreateClient; import com.simibubi.create.content.contraptions.components.saw.SawTileEntity; import com.simibubi.create.content.contraptions.goggles.IHaveHoveringInformation; import com.simibubi.create.content.contraptions.relays.belt.BeltHelper; @@ -14,6 +15,7 @@ import com.simibubi.create.content.logistics.block.funnel.BeltFunnelBlock.Shape; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.gui.widgets.InterpolatedChasingValue; import com.simibubi.create.foundation.item.TooltipHelper; +import com.simibubi.create.foundation.render.backend.instancing.IInstanceRendered; import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.belt.DirectBeltInputBehaviour; @@ -33,11 +35,13 @@ 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.minecraftforge.api.distmarker.Dist; import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; -public class FunnelTileEntity extends SmartTileEntity implements IHaveHoveringInformation { +public class FunnelTileEntity extends SmartTileEntity implements IHaveHoveringInformation, IInstanceRendered { private FilteringBehaviour filtering; private InvManipulationBehaviour invManipulation; @@ -381,4 +385,15 @@ public class FunnelTileEntity extends SmartTileEntity implements IHaveHoveringIn return true; } + @Override + public void initialize() { + super.initialize(); + if (world != null && world.isRemote) + DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> CreateClient.kineticRenderer.add(this)); + } + + @Override + public void onChunkLightUpdate() { + CreateClient.kineticRenderer.onLightUpdate(this); + } } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmRenderer.java b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmRenderer.java index 8e9a47e8c..40d8c9ccd 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmRenderer.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmRenderer.java @@ -50,7 +50,7 @@ public class ArmRenderer extends KineticTileEntityRenderer { float headAngle = arm.headAngle.get(pt); boolean rave = arm.phase == Phase.DANCING; - float renderTick = AnimationTickHolder.getRenderTick() + (te.hashCode() % 64); + float renderTick = AnimationTickHolder.getRenderTime() + (te.hashCode() % 64); if (rave) { baseAngle = (renderTick * 10) % 360; lowerArmAngle = MathHelper.lerp((MathHelper.sin(renderTick / 4) + 1) / 2, -45, 15); diff --git a/src/main/java/com/simibubi/create/foundation/advancement/AllTriggers.java b/src/main/java/com/simibubi/create/foundation/advancement/AllTriggers.java index 4f16caa6e..88084d2a4 100644 --- a/src/main/java/com/simibubi/create/foundation/advancement/AllTriggers.java +++ b/src/main/java/com/simibubi/create/foundation/advancement/AllTriggers.java @@ -19,9 +19,9 @@ public class AllTriggers { private static final List> triggers = new LinkedList<>(); - public static final RegistryTrigger INFINITE_FLUID = add(new RegistryTrigger<>("infinite_fluid", ForgeRegistries.FLUIDS)); - public static final RegistryTrigger BRACKET_APPLY_TRIGGER = add(new RegistryTrigger<>("bracket_apply", ForgeRegistries.BLOCKS)); - public static final EnumTrigger FAN_PROCESSING = add(new EnumTrigger<>("fan_processing", InWorldProcessing.Type.class)); + public static final StringSerializableTrigger INFINITE_FLUID = add(new RegistryTrigger<>("infinite_fluid", ForgeRegistries.FLUIDS)); + public static final StringSerializableTrigger BRACKET_APPLY_TRIGGER = add(new RegistryTrigger<>("bracket_apply", ForgeRegistries.BLOCKS)); + public static final StringSerializableTrigger FAN_PROCESSING = add(new EnumTrigger<>("fan_processing", InWorldProcessing.Type.class)); public static final SimpleTrigger ROTATION = simple("rotation"), diff --git a/src/main/java/com/simibubi/create/foundation/command/AllCommands.java b/src/main/java/com/simibubi/create/foundation/command/AllCommands.java index 760fe23c3..2f9471abb 100644 --- a/src/main/java/com/simibubi/create/foundation/command/AllCommands.java +++ b/src/main/java/com/simibubi/create/foundation/command/AllCommands.java @@ -28,6 +28,7 @@ public class AllCommands { .then(FixLightingCommand.register()) .then(HighlightCommand.register()) .then(CouplingCommand.register()) + .then(CloneCommand.register()) //utility .then(util) @@ -47,10 +48,10 @@ public class AllCommands { private static LiteralCommandNode buildUtilityCommands() { return Commands.literal("util") - .then(FlySpeedCommand.register()) .then(ReplaceInCommandBlocksCommand.register()) .then(ClearBufferCacheCommand.register()) .then(ChunkUtilCommand.register()) + .then(FlySpeedCommand.register()) //.then(KillTPSCommand.register()) .build(); diff --git a/src/main/java/com/simibubi/create/foundation/command/CloneCommand.java b/src/main/java/com/simibubi/create/foundation/command/CloneCommand.java new file mode 100644 index 000000000..d5a07c8fc --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/command/CloneCommand.java @@ -0,0 +1,170 @@ +package com.simibubi.create.foundation.command; + +import com.google.common.collect.Lists; +import com.mojang.brigadier.Command; +import com.mojang.brigadier.builder.ArgumentBuilder; +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType; +import com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueEntity; +import com.simibubi.create.foundation.utility.Pair; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.command.CommandSource; +import net.minecraft.command.Commands; +import net.minecraft.command.arguments.BlockPosArgument; +import net.minecraft.inventory.IClearable; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.CachedBlockInfo; +import net.minecraft.util.Direction; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MutableBoundingBox; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.TranslationTextComponent; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.server.ServerWorld; + +import java.util.List; + +public class CloneCommand { + + private static final Dynamic2CommandExceptionType CLONE_TOO_BIG_EXCEPTION = new Dynamic2CommandExceptionType((arg1, arg2) -> new TranslationTextComponent("commands.clone.toobig", arg1, arg2)); + + public static ArgumentBuilder register() { + return Commands.literal("clone") + .requires(cs -> cs.hasPermissionLevel(2)) + .then(Commands.argument("begin", BlockPosArgument.blockPos()) + .then(Commands.argument("end", BlockPosArgument.blockPos()) + .then(Commands.argument("destination", BlockPosArgument.blockPos()) + .then(Commands.literal("skipBlocks") + .executes(ctx -> doClone(ctx.getSource(), BlockPosArgument.getLoadedBlockPos(ctx, "begin"), BlockPosArgument.getLoadedBlockPos(ctx, "end"), BlockPosArgument.getLoadedBlockPos(ctx, "destination"), false)) + ) + .executes(ctx -> doClone(ctx.getSource(), BlockPosArgument.getLoadedBlockPos(ctx, "begin"), BlockPosArgument.getLoadedBlockPos(ctx, "end"), BlockPosArgument.getLoadedBlockPos(ctx, "destination"), true)) + ) + ) + ) + .executes(ctx -> { + ctx.getSource().sendFeedback(new StringTextComponent("Clones all blocks as well as super glue from the specified area to the target destination"), true); + + return Command.SINGLE_SUCCESS; + }); + + + } + + private static int doClone(CommandSource source, BlockPos begin, BlockPos end, BlockPos destination, boolean cloneBlocks) throws CommandSyntaxException { + MutableBoundingBox sourceArea = new MutableBoundingBox(begin, end); + BlockPos destinationEnd = destination.add(sourceArea.getLength()); + MutableBoundingBox destinationArea = new MutableBoundingBox(destination, destinationEnd); + + int i = sourceArea.getXSize() * sourceArea.getYSize() * sourceArea.getZSize(); + if (i > 32768) + throw CLONE_TOO_BIG_EXCEPTION.create(32768, i); + + ServerWorld world = source.getWorld(); + + if (!world.isAreaLoaded(begin, end) || !world.isAreaLoaded(destination, destinationEnd)) + throw BlockPosArgument.POS_UNLOADED.create(); + + BlockPos diffToTarget = new BlockPos(destinationArea.minX - sourceArea.minX, destinationArea.minY - sourceArea.minY, destinationArea.minZ - sourceArea.minZ); + + int blockPastes = cloneBlocks ? cloneBlocks(sourceArea, world, diffToTarget) : 0; + int gluePastes = cloneGlue(sourceArea, world, diffToTarget); + + if (cloneBlocks) + source.sendFeedback(new StringTextComponent("Successfully cloned " + blockPastes + " Blocks"), true); + + source.sendFeedback(new StringTextComponent("Successfully applied glue " + gluePastes + " times"), true); + return blockPastes + gluePastes; + + } + + private static int cloneGlue(MutableBoundingBox sourceArea, ServerWorld world, BlockPos diffToTarget) { + int gluePastes = 0; + + List glue = world.getEntitiesWithinAABB(SuperGlueEntity.class, AxisAlignedBB.func_216363_a(sourceArea)); + List> newGlue = Lists.newArrayList(); + + for (SuperGlueEntity g : glue) { + BlockPos pos = g.getHangingPosition(); + Direction direction = g.getFacingDirection(); + newGlue.add(Pair.of(pos.add(diffToTarget), direction)); + } + + for (Pair p : newGlue) { + SuperGlueEntity g = new SuperGlueEntity(world, p.getFirst(), p.getSecond()); + if (g.onValidSurface()){ + world.addEntity(g); + gluePastes++; + } + } + return gluePastes; + } + + private static int cloneBlocks(MutableBoundingBox sourceArea, ServerWorld world, BlockPos diffToTarget) { + int blockPastes = 0; + + List blocks = Lists.newArrayList(); + List tileBlocks = Lists.newArrayList(); + + for (int z = sourceArea.minZ; z <= sourceArea.maxZ; ++z) { + for (int y = sourceArea.minY; y <= sourceArea.maxY; ++y) { + for (int x = sourceArea.minX; x <= sourceArea.maxX; ++x) { + BlockPos currentPos = new BlockPos(x, y, z); + BlockPos newPos = currentPos.add(diffToTarget); + CachedBlockInfo cached = new CachedBlockInfo(world, currentPos, false); + BlockState state = cached.getBlockState(); + TileEntity te = world.getTileEntity(currentPos); + if (te != null) { + CompoundNBT nbt = te.write(new CompoundNBT()); + tileBlocks.add(new Template.BlockInfo(newPos, state, nbt)); + } else { + blocks.add(new Template.BlockInfo(newPos, state, null)); + } + } + } + } + + List allBlocks = Lists.newArrayList(); + allBlocks.addAll(blocks); + allBlocks.addAll(tileBlocks); + + List reverse = Lists.reverse(allBlocks); + + for (Template.BlockInfo info : reverse) { + TileEntity te = world.getTileEntity(info.pos); + IClearable.clearObj(te); + world.setBlockState(info.pos, Blocks.BARRIER.getDefaultState(), 2); + } + + for (Template.BlockInfo info : allBlocks) { + if (world.setBlockState(info.pos, info.state, 2)) + blockPastes++; + } + + for (Template.BlockInfo info : tileBlocks) { + TileEntity te = world.getTileEntity(info.pos); + if (te != null && info.nbt != null) { + info.nbt.putInt("x", info.pos.getX()); + info.nbt.putInt("y", info.pos.getY()); + info.nbt.putInt("z", info.pos.getZ()); + te.read(info.nbt); + te.markDirty(); + } + + //idk why the state is set twice for a te, but its done like this in the original clone command + world.setBlockState(info.pos, info.state, 2); + } + + for (Template.BlockInfo info : reverse) { + world.notifyNeighbors(info.pos, info.state.getBlock()); + } + + + world.getPendingBlockTicks().copyTicks(sourceArea, diffToTarget); + + return blockPastes; + } + +} diff --git a/src/main/java/com/simibubi/create/foundation/command/CouplingCommand.java b/src/main/java/com/simibubi/create/foundation/command/CouplingCommand.java index 8e4512956..62cb360f1 100644 --- a/src/main/java/com/simibubi/create/foundation/command/CouplingCommand.java +++ b/src/main/java/com/simibubi/create/foundation/command/CouplingCommand.java @@ -1,7 +1,9 @@ package com.simibubi.create.foundation.command; +import com.google.common.collect.Lists; import com.mojang.brigadier.Command; import com.mojang.brigadier.builder.ArgumentBuilder; +import com.mojang.brigadier.exceptions.DynamicCommandExceptionType; import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; import com.simibubi.create.content.contraptions.components.structureMovement.train.CouplingHandler; import com.simibubi.create.content.contraptions.components.structureMovement.train.capability.CapabilityMinecartController; @@ -16,12 +18,15 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.text.StringTextComponent; import net.minecraftforge.common.util.LazyOptional; +import java.util.ArrayList; +import java.util.Collection; import java.util.UUID; public class CouplingCommand { public static final SimpleCommandExceptionType ONLY_MINECARTS_ALLOWED = new SimpleCommandExceptionType(new StringTextComponent("Only Minecarts can be coupled")); public static final SimpleCommandExceptionType SAME_DIMENSION = new SimpleCommandExceptionType(new StringTextComponent("Minecarts have to be in the same Dimension")); + public static final DynamicCommandExceptionType TWO_CARTS = new DynamicCommandExceptionType(a -> new StringTextComponent("Your selector targeted " + a + " entities. You can only couple 2 Minecarts at a time.")); public static ArgumentBuilder register() { @@ -50,6 +55,31 @@ public class CouplingCommand { }) ) ) + .then(Commands.argument("carts", EntityArgument.entities()) + .executes(ctx -> { + Collection entities = EntityArgument.getEntities(ctx, "carts"); + if (entities.size() != 2) + throw TWO_CARTS.create(entities.size()); + + ArrayList eList = Lists.newArrayList(entities); + Entity cart1 = eList.get(0); + if (!(cart1 instanceof AbstractMinecartEntity)) + throw ONLY_MINECARTS_ALLOWED.create(); + + Entity cart2 = eList.get(1); + if (!(cart2 instanceof AbstractMinecartEntity)) + throw ONLY_MINECARTS_ALLOWED.create(); + + if (!cart1.getEntityWorld().equals(cart2.getEntityWorld())) + throw SAME_DIMENSION.create(); + + Entity source = ctx.getSource().getEntity(); + + CouplingHandler.tryToCoupleCarts(source instanceof PlayerEntity ? (PlayerEntity) source : null, cart1.getEntityWorld(), cart1.getEntityId(), cart2.getEntityId()); + + return Command.SINGLE_SUCCESS; + }) + ) ) .then(Commands.literal("remove") .then(Commands.argument("cart1", EntityArgument.entity()) diff --git a/src/main/java/com/simibubi/create/foundation/data/recipe/FillingRecipeGen.java b/src/main/java/com/simibubi/create/foundation/data/recipe/FillingRecipeGen.java index 1b4a7f3fa..48486180e 100644 --- a/src/main/java/com/simibubi/create/foundation/data/recipe/FillingRecipeGen.java +++ b/src/main/java/com/simibubi/create/foundation/data/recipe/FillingRecipeGen.java @@ -26,6 +26,18 @@ public class FillingRecipeGen extends ProcessingRecipeGen { BLAZE_CAKE = create("blaze_cake", b -> b.require(Fluids.LAVA, 250) .require(AllItems.BLAZE_CAKE_BASE.get()) .output(AllItems.BLAZE_CAKE.get())), + + HONEYED_APPLE = create("honeyed_apple", b -> b.require(AllTags.forgeFluidTag("honey"), 250) + .require(Items.APPLE) + .output(AllItems.HONEYED_APPLE.get())), + + SWEET_ROLL = create("sweet_roll", b -> b.require(AllTags.forgeFluidTag("milk"), 250) + .require(Items.BREAD) + .output(AllItems.SWEET_ROLL.get())), + + CHOCOLATE_BERRIES = create("chocolate_glazed_berries", b -> b.require(AllFluids.CHOCOLATE.get(), 250) + .require(Items.SWEET_BERRIES) + .output(AllItems.CHOCOLATE_BERRIES.get())), GRASS_BLOCK = create("grass_block", b -> b.require(Fluids.WATER, 500) .require(Items.DIRT) diff --git a/src/main/java/com/simibubi/create/foundation/data/recipe/StandardRecipeGen.java b/src/main/java/com/simibubi/create/foundation/data/recipe/StandardRecipeGen.java index 0463ca346..6227918e6 100644 --- a/src/main/java/com/simibubi/create/foundation/data/recipe/StandardRecipeGen.java +++ b/src/main/java/com/simibubi/create/foundation/data/recipe/StandardRecipeGen.java @@ -317,7 +317,7 @@ public class StandardRecipeGen extends CreateRecipeProvider { .patternLine("P") .patternLine("A") .patternLine("P")), - + GANTRY_PINION = create(AllBlocks.GANTRY_PINION).unlockedBy(I::andesiteCasing) .viaShaped(b -> b.key('B', ItemTags.PLANKS) .key('S', I.cog()) @@ -669,6 +669,15 @@ public class StandardRecipeGen extends CreateRecipeProvider { LINEAR_CHASSIS_CYCLE = conversionCycle(ImmutableList.of(AllBlocks.LINEAR_CHASSIS, AllBlocks.SECONDARY_LINEAR_CHASSIS)), + STICKER = create(AllBlocks.STICKER).returns(1) + .unlockedBy(I::andesite) + .viaShaped(b -> b.key('I', I.andesite()) + .key('C', Tags.Items.COBBLESTONE) + .key('R', I.redstone()) + .key('S', Tags.Items.SLIMEBALLS) + .patternLine("ISI") + .patternLine("CRC")), + MINECART = create(() -> Items.MINECART).withSuffix("_from_contraption_cart") .unlockedBy(AllBlocks.CART_ASSEMBLER::get) .viaShapeless(b -> b.addIngredient(AllItems.MINECART_CONTRAPTION.get())), diff --git a/src/main/java/com/simibubi/create/foundation/mixin/NetworkLightUpdateMixin.java b/src/main/java/com/simibubi/create/foundation/mixin/NetworkLightUpdateMixin.java new file mode 100644 index 000000000..a40c2c088 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/mixin/NetworkLightUpdateMixin.java @@ -0,0 +1,43 @@ +package com.simibubi.create.foundation.mixin; + +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher; +import com.simibubi.create.foundation.render.backend.RenderWork; +import com.simibubi.create.foundation.render.backend.light.ILightListener; +import net.minecraft.client.Minecraft; +import net.minecraft.client.network.play.ClientPlayNetHandler; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.network.play.server.SUpdateLightPacket; +import net.minecraft.world.chunk.Chunk; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(ClientPlayNetHandler.class) +public class NetworkLightUpdateMixin { + + @Inject(at = @At("TAIL"), method = "handleUpdateLight") + private void onLightPacket(SUpdateLightPacket packet, CallbackInfo ci) { + RenderWork.enqueue(() -> { + ClientWorld world = Minecraft.getInstance().world; + + if (world == null) return; + + int chunkX = packet.getChunkX(); + int chunkZ = packet.getChunkZ(); + + Chunk chunk = world.getChunkProvider().getChunk(chunkX, chunkZ, false); + + if (chunk != null) { + chunk.getTileEntityMap() + .values() + .stream() + .filter(tile -> tile instanceof ILightListener) + .map(tile -> (ILightListener) tile) + .forEach(ILightListener::onChunkLightUpdate); + } + + ContraptionRenderDispatcher.notifyLightPacket(world, chunkX, chunkZ); + }); + } +} diff --git a/src/main/java/com/simibubi/create/foundation/mixin/RenderHooksMixin.java b/src/main/java/com/simibubi/create/foundation/mixin/RenderHooksMixin.java index 27f8173ce..d44d476b0 100644 --- a/src/main/java/com/simibubi/create/foundation/mixin/RenderHooksMixin.java +++ b/src/main/java/com/simibubi/create/foundation/mixin/RenderHooksMixin.java @@ -1,5 +1,7 @@ package com.simibubi.create.foundation.mixin; +import net.minecraft.client.renderer.*; +import net.minecraft.util.math.Vec3d; import org.lwjgl.opengl.GL20; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -14,9 +16,6 @@ import com.simibubi.create.foundation.render.backend.Backend; import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import com.simibubi.create.foundation.render.backend.OptifineHandler; -import net.minecraft.client.renderer.Matrix4f; -import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.world.ClientWorld; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -32,7 +31,7 @@ public class RenderHooksMixin { * layer-correct custom rendering. RenderWorldLast is not refined enough for rendering world objects. * This should probably be a forge event. */ - @Inject(at = @At(value = "TAIL"), method = "renderLayer") + @Inject(at = @At("TAIL"), method = "renderLayer") private void renderLayer(RenderType type, MatrixStack stack, double camX, double camY, double camZ, CallbackInfo ci) { if (!Backend.available()) return; @@ -46,7 +45,18 @@ public class RenderHooksMixin { GL20.glUseProgram(0); } - @Inject(at = @At(value = "TAIL"), method = "loadRenderers") + @Inject(at = @At(value = "INVOKE", target = "updateChunks(J)V"), method = "render") + private void setupFrame(MatrixStack p_228426_1_, float p_228426_2_, long p_228426_3_, boolean p_228426_5_, ActiveRenderInfo info, GameRenderer p_228426_7_, LightTexture p_228426_8_, Matrix4f p_228426_9_, CallbackInfo ci) { + Vec3d cameraPos = info.getProjectedView(); + double camX = cameraPos.getX(); + double camY = cameraPos.getY(); + double camZ = cameraPos.getZ(); + + CreateClient.kineticRenderer.beginFrame(camX, camY, camZ); + ContraptionRenderDispatcher.beginFrame(camX, camY, camZ); + } + + @Inject(at = @At("TAIL"), method = "loadRenderers") private void refresh(CallbackInfo ci) { CreateClient.kineticRenderer.invalidate(); ContraptionRenderDispatcher.invalidateAll(); diff --git a/src/main/java/com/simibubi/create/foundation/render/AllProgramSpecs.java b/src/main/java/com/simibubi/create/foundation/render/AllProgramSpecs.java index b5d5e991a..d943724d0 100644 --- a/src/main/java/com/simibubi/create/foundation/render/AllProgramSpecs.java +++ b/src/main/java/com/simibubi/create/foundation/render/AllProgramSpecs.java @@ -9,6 +9,7 @@ import com.simibubi.create.content.contraptions.components.actors.ActorVertexAtt import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionProgram; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionVertexAttributes; import com.simibubi.create.content.contraptions.relays.belt.BeltVertexAttributes; +import com.simibubi.create.content.logistics.block.FlapVertexAttributes; import com.simibubi.create.foundation.render.backend.gl.BasicProgram; import com.simibubi.create.foundation.render.backend.gl.attrib.ModelVertexAttributes; import com.simibubi.create.foundation.render.backend.gl.shader.ProgramSpec; @@ -33,6 +34,13 @@ public class AllProgramSpecs { .setFrag(Locations.INSTANCED) .createProgramSpec()); + public static final ProgramSpec FLAPS = register(ProgramSpec.builder("flap", BasicProgram::new) + .addAttributes(ModelVertexAttributes.class) + .addAttributes(FlapVertexAttributes.class) + .setVert(Locations.FLAP) + .setFrag(Locations.INSTANCED) + .createProgramSpec()); + public static final ProgramSpec CONTRAPTION_STRUCTURE = register(ProgramSpec.builder("contraption_structure", ContraptionProgram::new) .addAttributes(ContraptionVertexAttributes.class) .setVert(Locations.CONTRAPTION_STRUCTURE) @@ -57,6 +65,14 @@ public class AllProgramSpecs { .setDefines(ShaderConstants.define("CONTRAPTION")) .createProgramSpec()); + public static final ProgramSpec CONTRAPTION_FLAPS = register(ProgramSpec.builder("contraption_flap", ContraptionProgram::new) + .addAttributes(ModelVertexAttributes.class) + .addAttributes(FlapVertexAttributes.class) + .setVert(Locations.FLAP) + .setFrag(Locations.CONTRAPTION) + .setDefines(ShaderConstants.define("CONTRAPTION")) + .createProgramSpec()); + public static final ProgramSpec CONTRAPTION_ACTOR = register(ProgramSpec.builder("contraption_actor", ContraptionProgram::new) .addAttributes(ModelVertexAttributes.class) .addAttributes(ActorVertexAttributes.class) @@ -64,12 +80,14 @@ public class AllProgramSpecs { .setFrag(Locations.CONTRAPTION) .createProgramSpec()); + public static class Locations { public static final ResourceLocation INSTANCED = loc("instanced.frag"); public static final ResourceLocation CONTRAPTION = loc("contraption.frag"); public static final ResourceLocation ROTATING = loc("rotating.vert"); public static final ResourceLocation BELT = loc("belt.vert"); + public static final ResourceLocation FLAP = loc("flap.vert"); public static final ResourceLocation CONTRAPTION_STRUCTURE = loc("contraption_structure.vert"); public static final ResourceLocation CONTRAPTION_ACTOR = loc("contraption_actor.vert"); diff --git a/src/main/java/com/simibubi/create/foundation/render/KineticRenderer.java b/src/main/java/com/simibubi/create/foundation/render/KineticRenderer.java index 8517b7d03..68cb7367e 100644 --- a/src/main/java/com/simibubi/create/foundation/render/KineticRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/render/KineticRenderer.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import com.simibubi.create.content.contraptions.base.KineticRenderMaterials; import com.simibubi.create.content.contraptions.base.RotatingInstancedModel; import com.simibubi.create.content.contraptions.relays.belt.BeltInstancedModel; +import com.simibubi.create.content.logistics.block.FlapInstancedModel; import com.simibubi.create.foundation.render.backend.gl.BasicProgram; import com.simibubi.create.foundation.render.backend.gl.shader.ShaderCallback; import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; @@ -26,6 +27,7 @@ public class KineticRenderer extends InstancedTileRenderer { public void registerMaterials() { materials.put(KineticRenderMaterials.BELTS, new RenderMaterial<>(this, AllProgramSpecs.BELT, BeltInstancedModel::new)); materials.put(KineticRenderMaterials.ROTATING, new RenderMaterial<>(this, AllProgramSpecs.ROTATING, RotatingInstancedModel::new)); + materials.put(KineticRenderMaterials.FLAPS, new RenderMaterial<>(this, AllProgramSpecs.FLAPS, FlapInstancedModel::new)); } @Override diff --git a/src/main/java/com/simibubi/create/foundation/render/TileEntityRenderHelper.java b/src/main/java/com/simibubi/create/foundation/render/TileEntityRenderHelper.java index 0af8bcff9..0b6e7ff62 100644 --- a/src/main/java/com/simibubi/create/foundation/render/TileEntityRenderHelper.java +++ b/src/main/java/com/simibubi/create/foundation/render/TileEntityRenderHelper.java @@ -7,6 +7,7 @@ import com.simibubi.create.Create; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.utility.AnimationTickHolder; +import com.simibubi.create.foundation.utility.Debug; import com.simibubi.create.foundation.utility.MatrixStacker; import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorld; diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/Backend.java b/src/main/java/com/simibubi/create/foundation/render/backend/Backend.java index 6a416b187..5f53ee500 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/Backend.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/Backend.java @@ -3,14 +3,12 @@ package com.simibubi.create.foundation.render.backend; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; -import java.nio.ByteBuffer; import java.nio.FloatBuffer; -import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import java.util.function.Consumer; import java.util.function.Predicate; +import com.simibubi.create.foundation.render.backend.gl.versioned.GlFeatureCompat; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.lwjgl.opengl.GL; @@ -22,8 +20,6 @@ import com.simibubi.create.foundation.render.backend.gl.shader.GlProgram; import com.simibubi.create.foundation.render.backend.gl.shader.GlShader; import com.simibubi.create.foundation.render.backend.gl.shader.ProgramSpec; import com.simibubi.create.foundation.render.backend.gl.shader.ShaderType; -import com.simibubi.create.foundation.render.backend.gl.versioned.GlVersioned; -import com.simibubi.create.foundation.render.backend.gl.versioned.MapBuffer; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.TextureUtil; @@ -44,16 +40,12 @@ public class Backend { private static boolean enabled; public static GLCapabilities capabilities; - private static MapBuffer mapBuffer; + public static GlFeatureCompat compat; public Backend() { throw new IllegalStateException(); } - public static void mapBuffer(int target, int offset, int length, Consumer upload) { - mapBuffer.mapBuffer(target, offset, length, upload); - } - /** * Register a shader program. TODO: replace with forge registry? */ @@ -71,47 +63,21 @@ public class Backend { return (P) programs.get(spec); } - /** - * Get the most compatible version of a specific OpenGL feature by iterating over enum constants in order. - * - * @param clazz The class of the versioning enum. - * @param The type of the versioning enum. - * @return The first defined enum variant to return true. - */ - public static & GlVersioned> V getLatest(Class clazz) { - return getLatest(clazz, capabilities); - } - - /** - * Get the most compatible version of a specific OpenGL feature by iterating over enum constants in order. - * - * @param clazz The class of the versioning enum. - * @param caps The current system's supported features. - * @param The type of the versioning enum. - * @return The first defined enum variant to return true. - */ - public static & GlVersioned> V getLatest(Class clazz, GLCapabilities caps) { - V[] constants = clazz.getEnumConstants(); - V last = constants[constants.length - 1]; - if (!last.supported(caps)) { - throw new IllegalStateException(""); - } - - return Arrays.stream(constants).filter(it -> it.supported(caps)).findFirst().orElse(last); + public static boolean available() { + return canUseVBOs(); } public static boolean canUseInstancing() { - return enabled && gl33(); + return enabled && + compat.vertexArrayObjectsSupported() && + compat.drawInstancedSupported() && + compat.instancedArraysSupported(); } public static boolean canUseVBOs() { return enabled && gl20(); } - public static boolean available() { - return enabled && gl20(); - } - public static boolean gl33() { return capabilities.OpenGL33; } @@ -136,7 +102,7 @@ public class Backend { private static void onResourceManagerReload(IResourceManager manager, Predicate predicate) { if (predicate.test(VanillaResourceType.SHADERS)) { capabilities = GL.createCapabilities(); - mapBuffer = getLatest(MapBuffer.class); + compat = new GlFeatureCompat(capabilities); OptifineHandler.refresh(); refresh(); diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/BufferedModel.java b/src/main/java/com/simibubi/create/foundation/render/backend/BufferedModel.java index 79e4e4d2f..1050da53c 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/BufferedModel.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/BufferedModel.java @@ -14,11 +14,10 @@ import net.minecraft.client.renderer.BufferBuilder; public abstract class BufferedModel extends TemplateBuffer { - protected GlBuffer ebo; protected GlBuffer modelVBO; protected boolean removed; - public BufferedModel(BufferBuilder buf) { + protected BufferedModel(BufferBuilder buf) { super(buf); if (vertexCount > 0) init(); } @@ -28,8 +27,6 @@ public abstract class BufferedModel extends TemplateBuffer { modelVBO = new GlBuffer(GL20.GL_ARRAY_BUFFER); modelVBO.with(vbo -> initModel()); - - ebo = createEBO(); } protected void initModel() { @@ -47,25 +44,6 @@ public abstract class BufferedModel extends TemplateBuffer { }); } - protected final GlBuffer createEBO() { - GlBuffer ebo = new GlBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER); - - int indicesSize = vertexCount * GlPrimitiveType.USHORT.getSize(); - - ebo.bind(); - - GL15.glBufferData(GL15.GL_ELEMENT_ARRAY_BUFFER, indicesSize, GL15.GL_STATIC_DRAW); - ebo.map(indicesSize, indices -> { - for (int i = 0; i < vertexCount; i++) { - indices.putShort((short) i); - } - }); - - ebo.unbind(); - - return ebo; - } - protected abstract void copyVertex(ByteBuffer to, int index); protected abstract VertexFormat getModelFormat(); @@ -75,7 +53,7 @@ public abstract class BufferedModel extends TemplateBuffer { } /** - * Renders this model, checking first if it should actually be rendered. + * Renders this model, checking first if there is anything to render. */ public final void render() { if (vertexCount == 0 || removed) return; @@ -84,23 +62,9 @@ public abstract class BufferedModel extends TemplateBuffer { } /** - * Override this. + * Set up any state and make the draw calls. */ - protected void doRender() { - modelVBO.bind(); - ebo.bind(); - - setupAttributes(); - GL20.glDrawElements(GL20.GL_QUADS, vertexCount, GlPrimitiveType.USHORT.getGlConstant(), 0); - - int numAttributes = getTotalShaderAttributeCount(); - for (int i = 0; i <= numAttributes; i++) { - GL20.glDisableVertexAttribArray(i); - } - - ebo.unbind(); - modelVBO.unbind(); - } + protected abstract void doRender(); protected void setupAttributes() { int numAttributes = getTotalShaderAttributeCount(); @@ -111,7 +75,7 @@ public abstract class BufferedModel extends TemplateBuffer { getModelFormat().vertexAttribPointers(0); } - public void delete() { + public final void delete() { removed = true; if (vertexCount > 0) { RenderWork.enqueue(this::deleteInternal); diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/gl/BasicProgram.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/BasicProgram.java index 8d6f71711..2201626c1 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/gl/BasicProgram.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/BasicProgram.java @@ -43,7 +43,7 @@ public class BasicProgram extends GlProgram { super.bind(); GL20.glUniform1i(uDebug, debugMode); - GL20.glUniform1f(uTime, AnimationTickHolder.getRenderTick()); + GL20.glUniform1f(uTime, AnimationTickHolder.getRenderTime()); uploadMatrixUniform(uViewProjection, viewProjection); GL20.glUniform3f(uCameraPos, (float) camX, (float) camY, (float) camZ); diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlBuffer.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlBuffer.java index 42a72736b..1dbd256e5 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlBuffer.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlBuffer.java @@ -3,9 +3,8 @@ package com.simibubi.create.foundation.render.backend.gl; import java.nio.ByteBuffer; import java.util.function.Consumer; -import org.lwjgl.opengl.GL20; - import com.simibubi.create.foundation.render.backend.Backend; +import org.lwjgl.opengl.GL20; public class GlBuffer extends GlObject { @@ -35,11 +34,11 @@ public class GlBuffer extends GlObject { } public void map(int length, Consumer upload) { - Backend.mapBuffer(bufferType, 0, length, upload); + Backend.compat.mapBuffer(bufferType, 0, length, upload); } public void map(int offset, int length, Consumer upload) { - Backend.mapBuffer(bufferType, offset, length, upload); + Backend.compat.mapBuffer(bufferType, offset, length, upload); } protected void deleteInternal(int handle) { diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlPrimitiveType.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlPrimitiveType.java index 5e069fabf..c82b02a00 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlPrimitiveType.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlPrimitiveType.java @@ -2,25 +2,27 @@ package com.simibubi.create.foundation.render.backend.gl; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL20; @OnlyIn(Dist.CLIENT) public enum GlPrimitiveType { - FLOAT(4, "float", 5126), - UBYTE(1, "ubyte", 5121), - BYTE(1, "byte", 5120), - USHORT(2, "ushort", 5123), - SHORT(2, "short", 5122), - UINT(4, "uint", 5125), - INT(4, "int", 5124); + FLOAT(4, "float", GL11.GL_FLOAT), + UBYTE(1, "ubyte", GL11.GL_UNSIGNED_BYTE), + BYTE(1, "byte", GL11.GL_BYTE), + USHORT(2, "ushort", GL11.GL_UNSIGNED_SHORT), + SHORT(2, "short", GL11.GL_SHORT), + UINT(4, "uint", GL11.GL_UNSIGNED_INT), + INT(4, "int", GL11.GL_INT); private final int size; private final String displayName; private final int glConstant; - GlPrimitiveType(int p_i46095_3_, String p_i46095_4_, int p_i46095_5_) { - this.size = p_i46095_3_; - this.displayName = p_i46095_4_; - this.glConstant = p_i46095_5_; + GlPrimitiveType(int bytes, String name, int glEnum) { + this.size = bytes; + this.displayName = name; + this.glConstant = glEnum; } public int getSize() { diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlVertexArray.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlVertexArray.java index 33ff7461b..e4854990e 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlVertexArray.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlVertexArray.java @@ -2,19 +2,19 @@ package com.simibubi.create.foundation.render.backend.gl; import java.util.function.Consumer; -import org.lwjgl.opengl.GL30; +import com.simibubi.create.foundation.render.backend.Backend; public class GlVertexArray extends GlObject { public GlVertexArray() { - setHandle(GL30.glGenVertexArrays()); + setHandle(Backend.compat.genVertexArrays()); } public void bind() { - GL30.glBindVertexArray(handle()); + Backend.compat.bindVertexArray(handle()); } public void unbind() { - GL30.glBindVertexArray(0); + Backend.compat.bindVertexArray(0); } public void with(Consumer action) { @@ -24,6 +24,6 @@ public class GlVertexArray extends GlObject { } protected void deleteInternal(int handle) { - GL30.glDeleteVertexArrays(handle); + Backend.compat.deleteVertexArrays(handle); } } diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/DrawInstanced.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/DrawInstanced.java new file mode 100644 index 000000000..4c206581d --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/DrawInstanced.java @@ -0,0 +1,54 @@ +package com.simibubi.create.foundation.render.backend.gl.versioned; + +import org.lwjgl.opengl.*; + +public enum DrawInstanced implements GlVersioned { + GL31_DRAW_INSTANCED { + @Override + public boolean supported(GLCapabilities caps) { + return caps.OpenGL31; + } + + @Override + public void drawArraysInstanced(int mode, int first, int count, int primcount) { + GL31.glDrawArraysInstanced(mode, first, count, primcount); + } + }, + ARB_DRAW_INSTANCED { + @Override + public boolean supported(GLCapabilities caps) { + return caps.GL_ARB_draw_instanced; + } + + @Override + public void drawArraysInstanced(int mode, int first, int count, int primcount) { + ARBDrawInstanced.glDrawArraysInstancedARB(mode, first, count, primcount); + } + }, + EXT_DRAW_INSTANCED { + @Override + public boolean supported(GLCapabilities caps) { + return caps.GL_EXT_draw_instanced; + } + + @Override + public void drawArraysInstanced(int mode, int first, int count, int primcount) { + EXTDrawInstanced.glDrawArraysInstancedEXT(mode, first, count, primcount); + } + }, + UNSUPPORTED { + @Override + public boolean supported(GLCapabilities caps) { + return true; + } + + @Override + public void drawArraysInstanced(int mode, int first, int count, int primcount) { + throw new UnsupportedOperationException(); + } + } + + ; + + public abstract void drawArraysInstanced(int mode, int first, int count, int primcount); +} diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/GlFeatureCompat.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/GlFeatureCompat.java new file mode 100644 index 000000000..b2eba08e1 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/GlFeatureCompat.java @@ -0,0 +1,89 @@ +package com.simibubi.create.foundation.render.backend.gl.versioned; + +import org.lwjgl.opengl.GLCapabilities; + +import java.nio.ByteBuffer; +import java.util.Arrays; +import java.util.function.Consumer; + +/** + * An instance of this class stores information + * about what OpenGL features are available. + * + * Each field stores an enum variant that provides access to the + * most appropriate version of a feature for the current system. + */ +public class GlFeatureCompat { + public final MapBuffer mapBuffer; + + public final VertexArrayObject vertexArrayObject; + public final InstancedArrays instancedArrays; + public final DrawInstanced drawInstanced; + + public final RGPixelFormat pixelFormat; + + public GlFeatureCompat(GLCapabilities caps) { + mapBuffer = getLatest(MapBuffer.class, caps); + + vertexArrayObject = getLatest(VertexArrayObject.class, caps); + instancedArrays = getLatest(InstancedArrays.class, caps); + drawInstanced = getLatest(DrawInstanced.class, caps); + + pixelFormat = getLatest(RGPixelFormat.class, caps); + } + + public void mapBuffer(int target, int offset, int length, Consumer upload) { + mapBuffer.mapBuffer(target, offset, length, upload); + } + + public void vertexAttribDivisor(int index, int divisor) { + instancedArrays.vertexAttribDivisor(index, divisor); + } + + public void drawArraysInstanced(int mode, int first, int count, int primcount) { + drawInstanced.drawArraysInstanced(mode, first, count, primcount); + } + + public int genVertexArrays() { + return vertexArrayObject.genVertexArrays(); + } + + public void deleteVertexArrays(int array) { + vertexArrayObject.deleteVertexArrays(array); + } + + public void bindVertexArray(int array) { + vertexArrayObject.bindVertexArray(array); + } + + public boolean vertexArrayObjectsSupported() { + return vertexArrayObject != VertexArrayObject.UNSUPPORTED; + } + + public boolean instancedArraysSupported() { + return instancedArrays != InstancedArrays.UNSUPPORTED; + } + + public boolean drawInstancedSupported() { + return drawInstanced != DrawInstanced.UNSUPPORTED; + } + + /** + * Get the most compatible version of a specific OpenGL feature by iterating over enum constants in order. + * + * @param clazz The class of the versioning enum. + * @param caps The current system's supported features. + * @param The type of the versioning enum. + * @return The first defined enum variant to return true. + */ + public static & GlVersioned> V getLatest(Class clazz, GLCapabilities caps) { + V[] constants = clazz.getEnumConstants(); + V last = constants[constants.length - 1]; + if (!last.supported(caps)) { + throw new IllegalStateException(""); + } + + return Arrays.stream(constants).filter(it -> it.supported(caps)).findFirst().get(); + } +} + diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/GlVersioned.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/GlVersioned.java index 53d929ea0..6f456c802 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/GlVersioned.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/GlVersioned.java @@ -2,7 +2,15 @@ package com.simibubi.create.foundation.render.backend.gl.versioned; import org.lwjgl.opengl.GLCapabilities; - +/** + * This interface should be implemented by enums such that the + * last defined variant always returns true. + */ public interface GlVersioned { + /** + * Queries whether this variant is supported by the current system. + * @param caps The {@link GLCapabilities} reported by the current system. + * @return true if this variant is supported, or if this is the last defined variant. + */ boolean supported(GLCapabilities caps); } diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/InstancedArrays.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/InstancedArrays.java new file mode 100644 index 000000000..1c000a37d --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/InstancedArrays.java @@ -0,0 +1,43 @@ +package com.simibubi.create.foundation.render.backend.gl.versioned; + +import org.lwjgl.opengl.*; + +public enum InstancedArrays implements GlVersioned { + GL33_INSTANCED_ARRAYS { + @Override + public boolean supported(GLCapabilities caps) { + return caps.OpenGL33; + } + + @Override + public void vertexAttribDivisor(int index, int divisor) { + GL33.glVertexAttribDivisor(index, divisor); + } + }, + ARB_INSTANCED_ARRAYS { + @Override + public boolean supported(GLCapabilities caps) { + return caps.GL_ARB_instanced_arrays; + } + + @Override + public void vertexAttribDivisor(int index, int divisor) { + ARBInstancedArrays.glVertexAttribDivisorARB(index, divisor); + } + }, + UNSUPPORTED { + @Override + public boolean supported(GLCapabilities caps) { + return true; + } + + @Override + public void vertexAttribDivisor(int index, int divisor) { + throw new UnsupportedOperationException(); + } + } + + ; + + public abstract void vertexAttribDivisor(int index, int divisor); +} diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/RGPixelFormat.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/RGPixelFormat.java new file mode 100644 index 000000000..9cf035535 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/RGPixelFormat.java @@ -0,0 +1,75 @@ +package com.simibubi.create.foundation.render.backend.gl.versioned; + +import org.lwjgl.opengl.*; + +public enum RGPixelFormat implements GlVersioned { + GL30_RG { + @Override + public boolean supported(GLCapabilities caps) { + return caps.OpenGL30; + } + + @Override + public int internalFormat() { + return GL30.GL_RG8; + } + + @Override + public int format() { + return GL30.GL_RG; + } + + @Override + public int byteCount() { + return 2; + } + }, + GL11_RGB { + @Override + public boolean supported(GLCapabilities caps) { + return caps.OpenGL11; + } + + @Override + public int internalFormat() { + return GL11.GL_RGB8; + } + + @Override + public int format() { + return GL11.GL_RGB; + } + + @Override + public int byteCount() { + return 3; + } + }, + UNSUPPORTED { + @Override + public boolean supported(GLCapabilities caps) { + return true; + } + + @Override + public int internalFormat() { + throw new UnsupportedOperationException(); + } + + @Override + public int format() { + throw new UnsupportedOperationException(); + } + + @Override + public int byteCount() { + throw new UnsupportedOperationException(); + } + } + + ; + + public abstract int internalFormat(); + public abstract int format(); + public abstract int byteCount(); +} diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/VertexArrayObject.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/VertexArrayObject.java new file mode 100644 index 000000000..58b9f0fc8 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/versioned/VertexArrayObject.java @@ -0,0 +1,77 @@ +package com.simibubi.create.foundation.render.backend.gl.versioned; + +import org.lwjgl.opengl.*; + +public enum VertexArrayObject implements GlVersioned { + GL30_VAO { + @Override + public boolean supported(GLCapabilities caps) { + return caps.OpenGL30; + } + + @Override + public int genVertexArrays() { + return GL30.glGenVertexArrays(); + } + + @Override + public void bindVertexArray(int array) { + GL30.glBindVertexArray(array); + } + + @Override + public void deleteVertexArrays(int array) { + GL30.glDeleteVertexArrays(array); + } + }, + ARB_VAO { + @Override + public boolean supported(GLCapabilities caps) { + return caps.GL_ARB_vertex_array_object; + } + + @Override + public int genVertexArrays() { + return ARBVertexArrayObject.glGenVertexArrays(); + } + + @Override + public void bindVertexArray(int array) { + ARBVertexArrayObject.glBindVertexArray(array); + } + + @Override + public void deleteVertexArrays(int array) { + ARBVertexArrayObject.glDeleteVertexArrays(array); + } + }, + UNSUPPORTED { + @Override + public boolean supported(GLCapabilities caps) { + return true; + } + + @Override + public int genVertexArrays() { + throw new UnsupportedOperationException(); + } + + @Override + public void bindVertexArray(int array) { + throw new UnsupportedOperationException(); + } + + @Override + public void deleteVertexArrays(int array) { + throw new UnsupportedOperationException(); + } + } + + ; + + public abstract int genVertexArrays(); + + public abstract void bindVertexArray(int array); + + public abstract void deleteVertexArrays(int array); +} diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/instancing/ITickableInstance.java b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/ITickableInstance.java new file mode 100644 index 000000000..4d79545a4 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/ITickableInstance.java @@ -0,0 +1,8 @@ +package com.simibubi.create.foundation.render.backend.instancing; + +public interface ITickableInstance { + /** + * Called every frame, this can be used to make more dynamic animations. + */ + void tick(); +} diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedModel.java b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedModel.java index b18cffcc4..5903ae496 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedModel.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedModel.java @@ -5,11 +5,10 @@ import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.function.Consumer; +import com.simibubi.create.foundation.render.backend.Backend; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL15; import org.lwjgl.opengl.GL20; -import org.lwjgl.opengl.GL31; -import org.lwjgl.opengl.GL33; import com.simibubi.create.foundation.render.RenderMath; import com.simibubi.create.foundation.render.backend.BufferedModel; @@ -116,7 +115,7 @@ public abstract class InstancedModel extends BufferedMod protected void doRender() { vao.with(vao -> { renderSetup(); - GL31.glDrawArraysInstanced(GL11.GL_QUADS, 0, vertexCount, glInstanceCount); + Backend.compat.drawArraysInstanced(GL11.GL_QUADS, 0, vertexCount, glInstanceCount); }); } @@ -163,7 +162,7 @@ public abstract class InstancedModel extends BufferedMod instanceFormat.vertexAttribPointers(staticAttributes); for (int i = 0; i < instanceFormat.getShaderAttributeCount(); i++) { - GL33.glVertexAttribDivisor(i + staticAttributes, 1); + Backend.compat.vertexAttribDivisor(i + staticAttributes, 1); } }); diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedTileRenderer.java b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedTileRenderer.java index 4f22c016f..325a3c3a5 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedTileRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedTileRenderer.java @@ -1,8 +1,6 @@ package com.simibubi.create.foundation.render.backend.instancing; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; +import java.util.*; import javax.annotation.Nullable; @@ -10,20 +8,19 @@ import com.simibubi.create.foundation.render.backend.Backend; import com.simibubi.create.foundation.render.backend.gl.BasicProgram; import com.simibubi.create.foundation.render.backend.gl.shader.ShaderCallback; import com.simibubi.create.foundation.utility.AnimationTickHolder; -import com.simibubi.create.foundation.utility.WorldAttached; -import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Matrix4f; import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.world.ClientWorld; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.World; public abstract class InstancedTileRenderer

{ - public static WorldAttached> addedLastTick = new WorldAttached<>(ConcurrentHashMap::new); - protected Map> instances = new HashMap<>(); + protected Map tickableInstances = new HashMap<>(); + protected Map, RenderMaterial> materials = new HashMap<>(); protected InstancedTileRenderer() { @@ -35,23 +32,8 @@ public abstract class InstancedTileRenderer

{ public abstract void registerMaterials(); public void tick() { - ClientWorld world = Minecraft.getInstance().world; - int ticks = AnimationTickHolder.getTicks(); - ConcurrentHashMap map = addedLastTick.get(world); - map - .entrySet() - .stream() - .filter(it -> ticks - it.getValue() > 10) - .map(Map.Entry::getKey) - .forEach(te -> { - map.remove(te); - - onLightUpdate(te); - }); - - // Clean up twice a second. This doesn't have to happen every tick, // but this does need to be run to ensure we don't miss anything. if (ticks % 10 == 0) { @@ -59,6 +41,21 @@ public abstract class InstancedTileRenderer

{ } } + public void beginFrame(double cameraX, double cameraY, double cameraZ) { + tickableInstances.values().forEach(ITickableInstance::tick); + } + + public void render(RenderType layer, Matrix4f viewProjection, double camX, double camY, double camZ) { + render(layer, viewProjection, camX, camY, camZ, null); + } + + public void render(RenderType layer, Matrix4f viewProjection, double camX, double camY, double camZ, ShaderCallback

callback) { + for (RenderMaterial material : materials.values()) { + if (material.canRenderInLayer(layer)) + material.render(layer, viewProjection, camX, camY, camZ, callback); + } + } + @SuppressWarnings("unchecked") public > RenderMaterial getMaterial(MaterialType materialType) { return (RenderMaterial) materials.get(materialType); @@ -72,7 +69,7 @@ public abstract class InstancedTileRenderer

{ @SuppressWarnings("unchecked") @Nullable public TileEntityInstance getInstance(T tile, boolean create) { - if (!Backend.canUseInstancing()) return null; + if (!Backend.canUseInstancing() || isTileUnloaded(tile)) return null; TileEntityInstance instance = instances.get(tile); @@ -82,8 +79,10 @@ public abstract class InstancedTileRenderer

{ TileEntityInstance renderer = InstancedTileRenderRegistry.instance.create(this, tile); if (renderer != null) { - addedLastTick.get(tile.getWorld()).put(tile, AnimationTickHolder.getTicks()); instances.put(tile, renderer); + + if (renderer instanceof ITickableInstance) + tickableInstances.put(tile, (ITickableInstance) renderer); } return renderer; @@ -131,6 +130,7 @@ public abstract class InstancedTileRenderer

{ if (instance != null) { instance.remove(); instances.remove(tile); + tickableInstances.remove(tile); } } } @@ -146,14 +146,17 @@ public abstract class InstancedTileRenderer

{ instances.clear(); } - public void render(RenderType layer, Matrix4f viewProjection, double camX, double camY, double camZ) { - render(layer, viewProjection, camX, camY, camZ, null); - } + public boolean isTileUnloaded(TileEntity tile) { + if (tile.isRemoved()) return true; - public void render(RenderType layer, Matrix4f viewProjection, double camX, double camY, double camZ, ShaderCallback

callback) { - for (RenderMaterial material : materials.values()) { - if (material.canRenderInLayer(layer)) - material.render(layer, viewProjection, camX, camY, camZ, callback); - } + World world = tile.getWorld(); + + if (world == null) return true; + + BlockPos pos = tile.getPos(); + + IBlockReader existingChunk = world.getExistingChunk(pos.getX() >> 4, pos.getZ() >> 4); + + return existingChunk == null; } } diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/instancing/TileEntityInstance.java b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/TileEntityInstance.java index ed4b1f162..8683832da 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/instancing/TileEntityInstance.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/TileEntityInstance.java @@ -42,7 +42,7 @@ public abstract class TileEntityInstance { * Update changed instance data using the {@link InstanceKey}s you got in {@link #init()}. * You don't have to update light data. That should be done in {@link #updateLight()} */ - protected abstract void onUpdate(); + protected void onUpdate() { } /** * Called when a light update occurs in the world. If your model needs it, update light here. diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/light/GridAlignedBB.java b/src/main/java/com/simibubi/create/foundation/render/backend/light/GridAlignedBB.java index 707efc0bd..e25fe1924 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/light/GridAlignedBB.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/light/GridAlignedBB.java @@ -53,6 +53,17 @@ public class GridAlignedBB { pos.getWorldEndZ() + 1); } + public static GridAlignedBB fromChunk(int sectionX, int sectionZ) { + int startX = sectionX << 4; + int startZ = sectionZ << 4; + return new GridAlignedBB(startX, + 0, + startZ, + startX + 16, + 256, + startZ + 16); + } + public static AxisAlignedBB toAABB(GridAlignedBB bb) { return new AxisAlignedBB(bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ); } diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/light/LightVolume.java b/src/main/java/com/simibubi/create/foundation/render/backend/light/LightVolume.java index 143964ba5..5f9290974 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/light/LightVolume.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/light/LightVolume.java @@ -2,11 +2,12 @@ package com.simibubi.create.foundation.render.backend.light; import java.nio.ByteBuffer; +import com.simibubi.create.foundation.render.backend.Backend; +import com.simibubi.create.foundation.render.backend.gl.versioned.RGPixelFormat; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL13; import org.lwjgl.opengl.GL20; -import org.lwjgl.opengl.GL40; import org.lwjgl.system.MemoryUtil; import com.simibubi.create.foundation.render.backend.RenderWork; @@ -28,11 +29,15 @@ public class LightVolume { private final GlTexture glTexture; + private final RGPixelFormat pixelFormat; + public LightVolume(GridAlignedBB sampleVolume) { setSampleVolume(sampleVolume); + pixelFormat = Backend.compat.pixelFormat; + this.glTexture = new GlTexture(GL20.GL_TEXTURE_3D); - this.lightData = MemoryUtil.memAlloc(this.textureVolume.volume() * 2); // TODO: reduce this to span only sampleVolume + this.lightData = MemoryUtil.memAlloc(this.textureVolume.volume() * pixelFormat.byteCount()); // allocate space for the texture GL20.glActiveTexture(GL20.GL_TEXTURE4); @@ -41,7 +46,7 @@ public class LightVolume { int sizeX = textureVolume.sizeX(); int sizeY = textureVolume.sizeY(); int sizeZ = textureVolume.sizeZ(); - GL12.glTexImage3D(GL12.GL_TEXTURE_3D, 0, GL40.GL_RG8, sizeX, sizeY, sizeZ, 0, GL40.GL_RG, GL40.GL_UNSIGNED_BYTE, 0); + GL12.glTexImage3D(GL12.GL_TEXTURE_3D, 0, pixelFormat.internalFormat(), sizeX, sizeY, sizeZ, 0, pixelFormat.format(), GL20.GL_UNSIGNED_BYTE, 0); glTexture.unbind(); GL20.glActiveTexture(GL20.GL_TEXTURE0); @@ -128,6 +133,15 @@ public class LightVolume { else if (type == LightType.SKY) copySky(world, changedVolume); } + public void notifyLightPacket(ILightReader world, int chunkX, int chunkZ) { + GridAlignedBB changedVolume = GridAlignedBB.fromChunk(chunkX, chunkZ); + if (!changedVolume.intersects(sampleVolume)) + return; + changedVolume.intersectAssign(sampleVolume); // compute the region contained by us that has dirty lighting data. + + copyLight(world, changedVolume); + } + /** * Completely (re)populate this volume with block and sky lighting data. * This is expensive and should be avoided. @@ -222,7 +236,7 @@ public class LightVolume { // just in case something goes wrong or we accidentally call this before this volume is properly disposed of. if (lightData == null || removed) return; - GL13.glActiveTexture(GL40.GL_TEXTURE4); + GL13.glActiveTexture(GL20.GL_TEXTURE4); glTexture.bind(); GL11.glTexParameteri(GL13.GL_TEXTURE_3D, GL13.GL_TEXTURE_MIN_FILTER, GL13.GL_LINEAR); GL11.glTexParameteri(GL13.GL_TEXTURE_3D, GL13.GL_TEXTURE_MAG_FILTER, GL13.GL_LINEAR); @@ -245,7 +259,7 @@ public class LightVolume { int sizeY = textureVolume.sizeY(); int sizeZ = textureVolume.sizeZ(); - GL12.glTexSubImage3D(GL12.GL_TEXTURE_3D, 0, 0, 0, 0, sizeX, sizeY, sizeZ, GL40.GL_RG, GL40.GL_UNSIGNED_BYTE, lightData); + GL12.glTexSubImage3D(GL12.GL_TEXTURE_3D, 0, 0, 0, 0, sizeX, sizeY, sizeZ, pixelFormat.format(), GL20.GL_UNSIGNED_BYTE, lightData); GL20.glPixelStorei(GL20.GL_UNPACK_ALIGNMENT, 4); // 4 is the default bufferDirty = false; @@ -269,7 +283,7 @@ public class LightVolume { byte b = (byte) ((block & 0xF) << 4); byte s = (byte) ((sky & 0xF) << 4); - int i = index(x, y, z); + int i = posToIndex(x, y, z); lightData.put(i, b); lightData.put(i + 1, s); } @@ -277,16 +291,16 @@ public class LightVolume { private void writeBlock(int x, int y, int z, int block) { byte b = (byte) ((block & 0xF) << 4); - lightData.put(index(x, y, z), b); + lightData.put(posToIndex(x, y, z), b); } private void writeSky(int x, int y, int z, int sky) { byte b = (byte) ((sky & 0xF) << 4); - lightData.put(index(x, y, z) + 1, b); + lightData.put(posToIndex(x, y, z) + 1, b); } - private int index(int x, int y, int z) { - return (x + textureVolume.sizeX() * (y + z * textureVolume.sizeY())) * 2; + private int posToIndex(int x, int y, int z) { + return (x + textureVolume.sizeX() * (y + z * textureVolume.sizeY())) * pixelFormat.byteCount(); } } diff --git a/src/main/java/com/simibubi/create/foundation/utility/AnimationTickHolder.java b/src/main/java/com/simibubi/create/foundation/utility/AnimationTickHolder.java index 4b8f410c5..b86ac025a 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/AnimationTickHolder.java +++ b/src/main/java/com/simibubi/create/foundation/utility/AnimationTickHolder.java @@ -16,7 +16,7 @@ public class AnimationTickHolder { } } - public static float getRenderTick() { + public static float getRenderTime() { return getTicks() + getPartialTicks(); } diff --git a/src/main/java/com/simibubi/create/foundation/utility/UniqueLinkedList.java b/src/main/java/com/simibubi/create/foundation/utility/UniqueLinkedList.java new file mode 100644 index 000000000..d30c3badb --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/utility/UniqueLinkedList.java @@ -0,0 +1,89 @@ +package com.simibubi.create.foundation.utility; + +import java.util.Collection; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +public class UniqueLinkedList extends LinkedList { + private final HashSet contained = new HashSet<>(); + + @Override + public boolean contains(Object o) { + return contained.contains(o); + } + + @Override + public E poll() { + E e = super.poll(); + contained.remove(e); + return e; + } + + @Override + public boolean add(E e) { + if (contained.add(e)) return super.add(e); + else return false; + } + + @Override + public void add(int index, E element) { + if (contained.add(element)) super.add(index, element); + } + + @Override + public void addFirst(E e) { + if (contained.add(e)) super.addFirst(e); + } + + @Override + public void addLast(E e) { + if (contained.add(e)) super.addLast(e); + } + + @Override + public boolean addAll(Collection c) { + List filtered = c.stream().filter(it -> !contained.contains(it)).collect(Collectors.toList()); + return super.addAll(filtered); + } + + @Override + public boolean addAll(int index, Collection c) { + List filtered = c.stream().filter(it -> !contained.contains(it)).collect(Collectors.toList()); + return super.addAll(index, filtered); + } + + @Override + public boolean remove(Object o) { + contained.remove(o); + return super.remove(o); + } + + @Override + public E remove(int index) { + E e = super.remove(index); + contained.remove(e); + return e; + } + + @Override + public E removeFirst() { + E e = super.removeFirst(); + contained.remove(e); + return e; + } + + @Override + public E removeLast() { + E e = super.removeLast(); + contained.remove(e); + return e; + } + + @Override + public void clear() { + super.clear(); + contained.clear(); + } +} diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index d70fcdb5c..17a263235 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -44,4 +44,6 @@ public com.mojang.blaze3d.platform.GlStateManager$BooleanState field_179201_b #f public net.minecraft.client.renderer.GameRenderer func_215311_a(Lnet/minecraft/client/renderer/ActiveRenderInfo;FZ)D #getFOVModifier # IResizeCallback -public net.minecraft.util.palette.IResizeCallback \ No newline at end of file +public net.minecraft.util.palette.IResizeCallback + +public net.minecraft.entity.Entity func_205011_p()V # updateAquatics \ No newline at end of file diff --git a/src/main/resources/assets/create/lang/es_es.json b/src/main/resources/assets/create/lang/es_es.json index 787422bb8..c8e41ac46 100644 --- a/src/main/resources/assets/create/lang/es_es.json +++ b/src/main/resources/assets/create/lang/es_es.json @@ -107,7 +107,7 @@ "block.create.dolomite_pillar": "Pilar de dolomita", "block.create.encased_chain_drive": "Cadena de transmisión revestida", "block.create.encased_fan": "Ventilador revestido", - "block.create.encased_fluid_pipe": "Tubería de fluidos de cobre revestida", + "block.create.encased_fluid_pipe": "Tubería de fluidos de cobre reforzada", "block.create.fancy_andesite_bricks": "Ladrillos de andesita elegantes", "block.create.fancy_andesite_bricks_slab": "Ladrillos de andesita elegantes", "block.create.fancy_andesite_bricks_stairs": "Escaleras de ladrillos de andesita elegantes", @@ -165,7 +165,7 @@ "block.create.gantry_shaft": "Eje de grúa", "block.create.gearbox": "Caja de transmisión", "block.create.gearshift": "Caja de cambios", - "block.create.glass_fluid_pipe": "Tubo de cristal para fluidos", + "block.create.glass_fluid_pipe": "Tubería de fluidos de cristal", "block.create.granite_bricks": "Ladrillos de granito", "block.create.granite_bricks_slab": "Losa de ladrillos de granito", "block.create.granite_bricks_stairs": "Escaleras de ladrillos de granito", @@ -349,7 +349,7 @@ "block.create.redstone_link": "Enlace de Redstone", "block.create.refined_radiance_casing": "Revestidor de radiante", "block.create.reinforced_rail": "Raíl reforzado", - "block.create.rope": "Soga", + "block.create.rope": "Cuerda", "block.create.rope_pulley": "Polea de cuerda", "block.create.rotation_speed_controller": "Controlador de velocidad de rotación", "block.create.sail_frame": "Marco de vela", @@ -506,7 +506,7 @@ "advancement.create.splitter_tunnel": "Divide y vencerás", "advancement.create.splitter_tunnel.desc": "Crear un divisor con un grupo de túneles de latón.", "advancement.create.chute": "Caída en picado", - "advancement.create.chute.desc": "Coloque un ducto, la contrapartida vertical de la correa.", + "advancement.create.chute.desc": "Coloque un ducto, la contrapartida vertical de la cinta.", "advancement.create.upward_chute": "Abducción aérea", "advancement.create.upward_chute.desc": "Observe cómo un objeto lanzado vuela hacia un paracaídas impulsado por un ventilador.", "advancement.create.belt_funnel": "Colgantes con forma de embudo", @@ -532,7 +532,7 @@ "advancement.create.aesthetics": "Boom, Estética!", "advancement.create.aesthetics.desc": "Colocar los soportes en un eje, tubo y rueda dentada.", "advancement.create.reinforced": "Boom, Reforzado!", - "advancement.create.reinforced.desc": "Utilizar bloques de revestimiento en un eje, un tubo y una correa.", + "advancement.create.reinforced.desc": "Utilizar bloques de revestimiento en un eje, un tubo y una cinta.", "advancement.create.water_wheel": "Aprovechar la hidráulica", "advancement.create.water_wheel.desc": "Coloca una Rueda hidráulica e intenta hacerla girar.", "advancement.create.chocolate_wheel": "Potencia de buen gusto", @@ -684,6 +684,7 @@ "create.recipe.mechanical_crafting": "Elaboración mecánica", "create.recipe.automatic_shaped": "Elaboración automatizada de productos con forma", "create.recipe.block_cutting": "Corte de bloques", + "create.recipe.wood_cutting": "Corte de maderas", "create.recipe.blockzapper_upgrade": "Blockzapper", "create.recipe.sandpaper_polishing": "Pulido con papel de lija", "create.recipe.mystery_conversion": "Conversión misteriosa", @@ -823,11 +824,12 @@ "create.gui.goggles.at_current_speed": "con la velocidad actual", "create.gui.goggles.pole_length": "Longitud del poste:", "create.gui.assembly.exception": "Este artilugio no se pudo montar:", - "create.gui.assembly.exception.unmovableBlock": "Bloque inamovible (%4$s) en [%1$s %2$s %3$s]", - "create.gui.assembly.exception.chunkNotLoaded": "El bloque en [%1$s %2$s %3$s] no estaba en un chunk cargado", + "create.gui.assembly.exception.unmovableBlock": "Bloque inamovible (%4$s) en [%1$s,%2$s,%3$s]", + "create.gui.assembly.exception.chunkNotLoaded": "El bloque en [%1$s,%2$s,%3$s] no estaba en un chunk cargado", "create.gui.assembly.exception.structureTooLarge": "Hay demasiados bloques incluídos en el artilugio.\nEl máximo configurado es: %1$s", "create.gui.assembly.exception.tooManyPistonPoles": "Hay demasiadas Pértigas de extensión conectadas a este Pistón.\nEl máximo configurado es: %1$s", "create.gui.assembly.exception.noPistonPoles": "Faltan pértigas de extensión para el Pistón", + "create.gui.assembly.exception.not_enough_sails": "La estructura adjunta no incluye suficientes bloques tipo vela: %1$s\nSe requiere un mínimo de %2$s", "create.gui.gauge.info_header": "Información sobre el medidor:", "create.gui.speedometer.title": "Velocidad de rotación", "create.gui.stressometer.title": "Estrés de la red", @@ -844,13 +846,19 @@ "create.gui.stockpile_switch.move_to_upper_at": "Pasar al carril superior en %1$s%%", "create.gui.sequenced_gearshift.title": "Cambio de marchas secuenciado", "create.gui.sequenced_gearshift.instruction": "Instrucción", + "create.gui.sequenced_gearshift.instruction.turn_angle.descriptive": "Giro por ángulo", "create.gui.sequenced_gearshift.instruction.turn_angle": "Giro", "create.gui.sequenced_gearshift.instruction.turn_angle.angle": "Ángulo", + "create.gui.sequenced_gearshift.instruction.turn_distance.descriptive": "Giro para mover el pistón/polea/grúa", "create.gui.sequenced_gearshift.instruction.turn_distance": "Pistón", "create.gui.sequenced_gearshift.instruction.turn_distance.distance": "Distancia", - "create.gui.sequenced_gearshift.instruction.wait": "Espera", - "create.gui.sequenced_gearshift.instruction.wait.duration": "Duración", + "create.gui.sequenced_gearshift.instruction.delay.descriptive": "Tiempo de retraso", + "create.gui.sequenced_gearshift.instruction.delay": "Retraso", + "create.gui.sequenced_gearshift.instruction.delay.duration": "Duración", + "create.gui.sequenced_gearshift.instruction.end.descriptive": "Fin", "create.gui.sequenced_gearshift.instruction.end": "Fin", + "create.gui.sequenced_gearshift.instruction.await.descriptive": "En espera de un Pulso de Redstone", + "create.gui.sequenced_gearshift.instruction.await": "En espera", "create.gui.sequenced_gearshift.speed": "Velocidad, Dirección", "create.gui.sequenced_gearshift.speed.forward": "Velocidad de entrada, hacia adelante", "create.gui.sequenced_gearshift.speed.forward_fast": "Doble velocidad, hacia adelante", @@ -1159,19 +1167,19 @@ "block.create.metal_bracket.tooltip.summary": "Decora tus _Ejes_, _Ruedas dentadas_ y _Ductos_ con un poco de refuerzo industrial robusto.", "block.create.andesite_casing.tooltip": "REVESTIDOR DE ANDESITA", - "block.create.andesite_casing.tooltip.summary": "Máquina de revestimiento simple con una variedad de usos. Seguro para la decoración. Puede utilizarse para _encastrar ejes_ y _correas._", + "block.create.andesite_casing.tooltip.summary": "Máquina de revestimiento simple con una variedad de usos. Seguro para la decoración. Puede utilizarse para _revestir ejes_ y _cintas._", "block.create.andesite_funnel.tooltip": "EMBUDO DE ANDESITA", "block.create.andesite_funnel.tooltip.summary": "Un componente de transferencia de elementos en general, que hace la transición de éstos entre los medios de transporte. Se puede controlar con una _señal de Redstone_.", "block.create.andesite_funnel.tooltip.condition1": "Comportamiento general", "block.create.andesite_funnel.tooltip.behaviour1": "La cara _abierta_ _recogerá los objetos molidos_ en el espacio del bloque que tiene delante y los _insertará_ en cualquier contenedor del lado opuesto del embudo", - "block.create.andesite_funnel.tooltip.condition2": "Cuando se montan en correas, depósitos y similares", + "block.create.andesite_funnel.tooltip.condition2": "Cuando se montan en cintas, depósitos y similares", "block.create.andesite_funnel.tooltip.behaviour2": "_Recoge_ o _Coloca_ los elementos en el componente montado, desde o hacia el inventario _detrás_ de sí mismo. Siempre que el embudo tenga una direccionalidad específica, puede invertirse utilizando una Llave.", "block.create.andesite_funnel.tooltip.condition3": "Cuando se encuentra verticalmente entre dos inventarios", "block.create.andesite_funnel.tooltip.behaviour3": "Transferirá los artículos hacia abajo, como una tolva sin búfer.", "block.create.andesite_tunnel.tooltip": "TÚNEL DE ANDESITA", - "block.create.andesite_tunnel.tooltip.summary": "¡Una cubierta protectora para sus _correas_!. El _Túnel de Andesita_ puede separar un elemento de una pila cuando se coloca otra correa o depósito al lado de la correa principal.", + "block.create.andesite_tunnel.tooltip.summary": "¡Una cubierta protectora para sus _cintas_!. El _Túnel de Andesita_ puede separar un elemento de una pila cuando se coloca otra cinta o depósito al lado de la cinta principal.", "block.create.andesite_tunnel.tooltip.control1": "Click derecho con la Llave Inglesa en el lateral", "block.create.andesite_tunnel.tooltip.action1": "_Ajusta las persianas de las ventanas_ si el túnel tiene una ventana en esa cara.", @@ -1179,15 +1187,15 @@ "block.create.brass_funnel.tooltip.summary": "Un componente de transferencia de elementos en general, que hace la transición de éstos entre los medios de transporte. Se puede controlar con una _señal de Redstone_. Viene con un práctico _filtro_.", "block.create.brass_funnel.tooltip.condition1": "Comportamiento General", "block.create.brass_funnel.tooltip.behaviour1": "La cara _abierta_ _recogerá los objetos molidos_ en el espacio del bloque que tiene delante y los _insertará_ en cualquier contenedor del lado opuesto del embudo.", - "block.create.brass_funnel.tooltip.condition2": "Cuando se montan en correas, depósitos y similares", + "block.create.brass_funnel.tooltip.condition2": "Cuando se montan en cintas, depósitos y similares", "block.create.brass_funnel.tooltip.behaviour2": "_Recoge_ o _Coloca_ los elementos en el componente montado, desde o hacia el inventario _detrás_ de sí mismo. Siempre que el embudo tenga una direccionalidad específica, puede invertirse utilizando una Llave Inglesa.", "block.create.brass_funnel.tooltip.condition3": "Cuando se encuentra verticalmente entre dos inventarios", "block.create.brass_funnel.tooltip.behaviour3": "Transfiere los artículos hacia abajo, como una tolva sin búfer.", "block.create.brass_tunnel.tooltip": "TÚNEL DE LATÓN", - "block.create.brass_tunnel.tooltip.summary": "Una cubierta protectora elegante para sus _correas_. Los _Túneles de latón_ también vienen con una serie de opciones de _Filtración_ y _División_ para sus artículos.", + "block.create.brass_tunnel.tooltip.summary": "Una cubierta protectora elegante para sus _cintas_. Los _Túneles de latón_ también vienen con una serie de opciones de _Filtración_ y _División_ para sus artículos.", "block.create.brass_tunnel.tooltip.condition1": "Cuando se colocan uno al lado del otro", - "block.create.brass_tunnel.tooltip.behaviour1": "Los túneles de latón se conectan entre sí y permiten redirigir el contenido de una correa a otra.", + "block.create.brass_tunnel.tooltip.behaviour1": "Los túneles de latón se conectan entre sí y permiten redirigir el contenido de una cinta a otra.", "block.create.brass_tunnel.tooltip.condition2": "Filtrado", "block.create.brass_tunnel.tooltip.behaviour2": "Los _Túneles de latón_ vienen con filtros tanto para la _Entrada_ como para la _Salida_. Si un _Elemento_ no está permitido desde la salida filtrada de un _Túnel_ será transferido a la salida de un _Túnel_ conectado.", "block.create.brass_tunnel.tooltip.condition3": "Dividiendo", @@ -1202,8 +1210,8 @@ "block.create.copper_casing.tooltip.condition1": "Cuando se utiliza en una tubería de fluidos", "block.create.copper_casing.tooltip.behaviour1": "_Reviste_ la _Tubería de fluidos_ con _Revestimiento de cobre_. Las tuberías de fluidos revestidas _bloquean sus conexiones_ en su lugar, dejando de reaccionar a los cambios en las tuberías vecinas.", - "block.create.encased_fluid_pipe.tooltip": "TUBO DE FLUIDOS REVESTIDO", - "block.create.encased_fluid_pipe.tooltip.summary": "Un tubo de fluidos revestido con cobre.", + "block.create.encased_fluid_pipe.tooltip": "TUBO DE FLUIDOS REFORZADO", + "block.create.encased_fluid_pipe.tooltip.summary": "Un tubo de fluidos reforzado con más cobre.", "block.create.copper_valve_handle.tooltip": "ASA DE VÁLVULA DE COBRE", "block.create.copper_valve_handle.tooltip.summary": "Una precisa _fuente_ de _fuerza de rotación_ que requiere la interacción de los jugadores. ¡Ten cuidado de no agotarte!", @@ -1218,12 +1226,12 @@ "block.create.chute.tooltip": "DUCTO", "block.create.chute.tooltip.summary": "_Recoge_ y _Transporta_ elementos en vertical o en diagonal. Puede tanto coger como colocar objetos en _contenedores de objetos_. También puede interactuar con los ductos desde el lateral utilizando _tolvas_ o _embudos montados_.", "block.create.chute.tooltip.condition1": "Cuando se alimenta con un ventilador", - "block.create.chute.tooltip.behaviour1": "Los ductos accionados por ventilador pueden transportar _elementos_ hacia arriba, y aspirar _elementos_ de los _depósitos_ y de las _correas_.", + "block.create.chute.tooltip.behaviour1": "Los ductos accionados por ventilador pueden transportar _elementos_ hacia arriba, y aspirar _elementos_ de los _depósitos_ y de las _cintas_.", "block.create.depot.tooltip": "DEPÓSITO", "block.create.depot.tooltip.summary": "Un lugar práctico para colocar sus _elementos_. Proporciona un punto de interacción para varias máquinas", "block.create.depot.tooltip.condition1": "Click derecho en el depósito", - "block.create.depot.tooltip.behaviour1": "Coloca o toma un _Elemento_ del _Depósito_. Los _Bloques_ y los _Artilugios_ que interactúan con una _Correa_ también funcionan en un _Depósito_.", + "block.create.depot.tooltip.behaviour1": "Coloca o toma un _Elemento_ del _Depósito_. Los _Bloques_ y los _Artilugios_ que interactúan con una _cinta_ también funcionan en un _Depósito_.", "item.create.blaze_cake.tooltip": "PASTEL DE BLAZE", "item.create.blaze_cake.tooltip.summary": "Un delicioso regalo para sus esforzados _Quemadores de blaze_. Los pone en marcha!.", @@ -1285,7 +1293,7 @@ "block.create.spout.tooltip.condition1": "Transferencia de fluidos", "block.create.spout.tooltip.behaviour1": "Cuando se coloca un _contenedor de fluidos_ como un _cubo_ o una _botella_ debajo, el caño intentará rellenarlo con su propio _fluido_ almacenado", "block.create.spout.tooltip.condition2": "Automatización de fluidos", - "block.create.spout.tooltip.behaviour2": "El caño colocado encima de una _correa_ o _depósito_ reaccionará automáticamente con un contenedor de fluidos_ que pase por debajo", + "block.create.spout.tooltip.behaviour2": "El caño colocado encima de una _cinta_ o _depósito_ reaccionará automáticamente con un contenedor de fluidos_ que pase por debajo", "block.create.item_drain.tooltip": "DRENADOR DE ELEMENTOS", "block.create.item_drain.tooltip.summary": "Un depósito rallado para vaciar tus _artículos fluidos._", @@ -1295,7 +1303,7 @@ "block.create.mechanical_arm.tooltip": "BRAZO MECÁNICO", "block.create.mechanical_arm.tooltip.summary": "Artilugio avanzado para reubicar _elementos_", "block.create.mechanical_arm.tooltip.condition1": "Transferencia de elementos", - "block.create.mechanical_arm.tooltip.behaviour1": "Puede tomar o colocar objetos en cualquier _inventario_ accesible_, como _Correas_, _Depósitos_, _Embudos_ y _Autoensambladores_", + "block.create.mechanical_arm.tooltip.behaviour1": "Puede tomar o colocar objetos en cualquier _inventario_ accesible_, como _Cintas_, _Depósitos_, _Embudos_ y _Autoensambladores_", "block.create.mechanical_arm.tooltip.control1": "Mientras está en la mano", "block.create.mechanical_arm.tooltip.action1": "Haz clic con el botón derecho en un _objeto accesible del inventario_ para establecerlo como _fuente_ para el _brazo mecánico_. Haz clic con el botón derecho del ratón dos veces para establecerlo como _destino_", "block.create.mechanical_arm.tooltip.control2": "Usa la rueda del ratón con la Llave Inglesa", @@ -1410,7 +1418,7 @@ "block.create.gearshift.tooltip.condition1": "Cuando se alimenta", "block.create.gearshift.tooltip.behaviour1": "_Invierte_ la rotación de salida", - "bloque.crear.embrague.información.sobre.herramientas": "EMBRAGUE", + "block.create.clutch.tooltip": "Embrague", "block.create.clutch.tooltip.summary": "Un control para conectar/desconectar la rotación de los ejes conectados", "block.create.clutch.tooltip.condition1": "Cuando se acciona", "block.create.clutch.tooltip.behaviour1": "_Detiene_ el transporte de la rotación al otro lado", @@ -1493,8 +1501,8 @@ "block.create.mechanical_press.tooltip.summary": "Un pistón de fuerza para comprimir los objetos que tiene debajo. Requiere una _fuerza de rotación_ constante", "block.create.mechanical_press.tooltip.condition1": "Cuando es impulsado por Redstone", "block.create.mechanical_press.tooltip.behaviour1": "Comienza a _comprimir_ los objetos que caen debajo", - "block.create.mechanical_press.tooltip.condition2": "Cuando está por encima de una correa", - "block.create.mechanical_press.tooltip.behaviour2": "Comprime _automáticamente_ los elementos de derivación en la correa", + "block.create.mechanical_press.tooltip.condition2": "Cuando está por encima de una cinta", + "block.create.mechanical_press.tooltip.behaviour2": "Comprime _automáticamente_ los elementos de derivación en la cinta", "block.create.mechanical_press.tooltip.condition3": "Cuando está por encima de la Cuenca", "block.create.mechanical_press.tooltip.behaviour3": "Comienza a _compactar artículos_ en la cuenca siempre que estén presentes todos los ingredientes necesarios", @@ -1519,13 +1527,13 @@ "block.create.mechanical_mixer.tooltip.behaviour1": "Comienza a mezclar los elementos en la cuenca siempre que estén presentes todos los ingredientes necesarios. Para evitar recetas no deseadas, utilice la ranura del filtro de la cuenca o reduzca la fuerza de rotación hasta que se hayan añadido todos los ingredientes deseados", "block.create.mechanical_crafter.tooltip": "AUTOENSAMBLADOR MECÁNICO", - "block.create.mechanical_crafter.tooltip.summary": "Un ensamblador cinético para _automatizar_ cualquier receta de _crafteo_ con forma. Coloca _múltiples en una cuadrícula_ correspondiente a tu receta, y _organiza sus correas_ para crear un _flujo_ que salga de la cuadrícula en uno de los Autoensambladores", + "block.create.mechanical_crafter.tooltip.summary": "Un ensamblador cinético para _automatizar_ cualquier receta de _crafteo_ con forma. Coloca _múltiples en una cuadrícula_ correspondiente a tu receta, y _organiza sus cintas_ para crear un _flujo_ que salga de la cuadrícula en uno de los Autoensambladores", "block.create.mechanical_crafter.tooltip.condition1": "Cuando es impulsado por la cinética", "block.create.mechanical_crafter.tooltip.behaviour1": "_Empieza el proceso de creación_ en cuanto _todos los crafters_ de la parrilla hayan recibido un objeto_", "block.create.mechanical_crafter.tooltip.condition2": "Con pulso de Redstone", "block.create.mechanical_crafter.tooltip.behaviour2": "_Fuerza_ el inicio del proceso de _creación_ con todos los _artículos_ dados actualmente en la parrilla", "block.create.mechanical_crafter.tooltip.control1": "Cuando se arranca por delante", - "block.create.mechanical_crafter.tooltip.action1": "_Circula la dirección_ hacia la que un autoensamblador individual _mueve sus objetos_. Para formar una cuadrícula de trabajo, _organiza las correas en un flujo_ que mueva todos los objetos hacia un autoensamblador final. El autoensamblador final debe _apuntar hacia fuera_ de la rejilla", + "block.create.mechanical_crafter.tooltip.action1": "_Circula la dirección_ hacia la que un autoensamblador individual _mueve sus objetos_. Para formar una cuadrícula de trabajo, _organiza las cintas en un flujo_ que mueva todos los objetos hacia un autoensamblador final. El autoensamblador final debe _apuntar hacia fuera_ de la rejilla", "block.create.mechanical_crafter.tooltip.control2": "Cuando se arranca hacia atrás", "block.create.mechanical_crafter.tooltip.action2": "Conecta_ el _inventario de entrada_ de los autoensambladores adyacentes. Usa esto para _combinar ranuras_ en la cuadrícula de trabajo y _guardar el la entrada de trabajo_", @@ -1630,7 +1638,7 @@ "block.create.secondary_linear_chassis.tooltip": "CHASIS LINEAL SECUNDARIO", "block.create.secondary_linear_chassis.tooltip.summary": "Un segundo tipo de _Chasis lineal_ que no se conecta al otro", - "bloque.crear.chasis_radial.tooltip": "CHASIS DE ROTACIÓN", + "block.create.radial_chassis.tooltip": "CHASIS RADIAL", "block.create.radial_chassis.tooltip.summary": "Bloque base configurable que conecta estructuras para el movimiento", "block.create.radial_chassis.tooltip.condition1": "Cuando se mueve", "block.create.radial_chassis.tooltip.behaviour1": "_Mueve_ todos los _Chasis_ adjuntos en una columna, y un cilindro de bloques a su alrededor. Los bloques que lo rodean sólo se mueven cuando están dentro del rango y están adheridos a un lado pegajoso (Ver [Ctrl]).", @@ -1716,7 +1724,7 @@ "block.create.deployer.tooltip.behaviour3": "El desplegador no se activará a menos que el elemento retenido _coincida_ con el _filtro._ Los elementos que no coincidan no podrán ser insertados; los elementos retenidos que coincidan con el filtro no podrán ser extraídos.", "block.create.brass_casing.tooltip": "REVESTIDOR DE LATÓN", - "block.create.brass_casing.tooltip.summary": "Resistente máquina revestidora con una gran variedad de usos. Segura para la decoración. Se puede utilizar para _revestir ejes_ y _correas._", + "block.create.brass_casing.tooltip.summary": "Resistente máquina revestidora con una gran variedad de usos. Segura para la decoración. Se puede utilizar para _revestir ejes_ y _cintas._", "block.create.pulse_repeater.tooltip": "REPETIDOR DE PULSOS DE REDSTONE", "block.create.pulse_repeater.tooltip.summary": "Un circuito sencillo para cortar las señales de Redstone que pasan a una longitud de _1 tick_", @@ -1792,6 +1800,6 @@ "create.tooltip.randomWipDescription7": "Este quizás no es para ti. ¿Qué tal ese?", "create.tooltip.randomWipDescription8": "Úsalo y arrepiéntete de tu decisión inmediatamente", - "_": "Gracias por traducir Create!" + "_": "Thank you for translating Create!" } diff --git a/src/main/resources/assets/create/lang/ru_ru.json b/src/main/resources/assets/create/lang/ru_ru.json index 87369b59b..d7197e071 100644 --- a/src/main/resources/assets/create/lang/ru_ru.json +++ b/src/main/resources/assets/create/lang/ru_ru.json @@ -773,7 +773,7 @@ "create.gui.terrainzapper.tool.overlay": "Наложение", "create.gui.terrainzapper.tool.flatten": "Выравнивание", - "create.terrainzapper.shiftRightClickToSet": "ПКМ крадясь, чтобы выбрать форму", + "create.terrainzapper.shiftRightClickToSet": "ПКМ крадучись, чтобы выбрать форму", "create.blockzapper.usingBlock": "С помощью: %1$s", "create.blockzapper.componentUpgrades": "Обновления компонентов:", @@ -1304,7 +1304,7 @@ "item.create.wand_of_symmetry.tooltip.action1": "_Создаёт_ или _Перемещает_ зеркало", "item.create.wand_of_symmetry.tooltip.control2": "ПКМ в воздух", "item.create.wand_of_symmetry.tooltip.action2": "_Убирает_ зеркало", - "item.create.wand_of_symmetry.tooltip.control3": "ПКМ крадясь", + "item.create.wand_of_symmetry.tooltip.control3": "ПКМ крадучись", "item.create.wand_of_symmetry.tooltip.action3": "Открывает _интерфейс_ _конфигурации_", "item.create.handheld_blockzapper.tooltip": "BLOCKZAPPER", @@ -1313,7 +1313,7 @@ "item.create.handheld_blockzapper.tooltip.action1": "Устанавливает выбранный блок как материал.", "item.create.handheld_blockzapper.tooltip.control2": "ПКМ на блок", "item.create.handheld_blockzapper.tooltip.action2": "_Размещает_ или _Замещает_ блок.", - "item.create.handheld_blockzapper.tooltip.control3": "ПКМ крадясь", + "item.create.handheld_blockzapper.tooltip.control3": "ПКМ крадучись", "item.create.handheld_blockzapper.tooltip.action3": "Открывает _интерфейс_ _конфигурации_", "item.create.handheld_worldshaper.tooltip": "HANDHELD WORLDSHAPER", @@ -1322,7 +1322,7 @@ "item.create.handheld_worldshaper.tooltip.action1": "Устанавливает блоки, помещенные инструментом, в целевой блок.", "item.create.handheld_worldshaper.tooltip.control2": "ПКМ на блок", "item.create.handheld_worldshaper.tooltip.action2": "Применяет выбранную _кисть_ и _инструмент_ в выбранном месте.", - "item.create.handheld_worldshaper.tooltip.control3": "ПКМ крадясь", + "item.create.handheld_worldshaper.tooltip.control3": "ПКМ крадучись", "item.create.handheld_worldshaper.tooltip.action3": "Открывает _интерфейс_ _конфигурации_", "item.create.tree_fertilizer.tooltip": "TREE FERTILIZER", @@ -1359,7 +1359,7 @@ "item.create.schematic.tooltip.summary": "Содержит структуру, которая будет позиционироваться и помещаться в мир. Расположите голограмму по своему усмотрению и используйте _схематичную пушку_ для ее построения.", "item.create.schematic.tooltip.condition1": "При удерживании", "item.create.schematic.tooltip.behaviour1": "Может быть позиционирован с помощью инструментов на экране.", - "item.create.schematic.tooltip.control1": "ПКМ крадясь", + "item.create.schematic.tooltip.control1": "ПКМ крадучись", "item.create.schematic.tooltip.action1": "Открывает _интерфейс_ для ввода _точных_ _координат_.", "item.create.schematic_and_quill.tooltip": "SCHEMATIC AND QUILL", @@ -1372,7 +1372,7 @@ "item.create.schematic_and_quill.tooltip.action1": "Выберите угловые точки / подтвердите сохранение.", "item.create.schematic_and_quill.tooltip.control2": "Удержание Ctrl", "item.create.schematic_and_quill.tooltip.action2": "Выберите точки в воздухе. Прокрутка для настройки расстояния.", - "item.create.schematic_and_quill.tooltip.control3": "ПКМ крадясь", + "item.create.schematic_and_quill.tooltip.control3": "ПКМ крадучись", "item.create.schematic_and_quill.tooltip.action3": "_Сбрасывает_ и _удаляет_ выделение.", "block.create.schematicannon.tooltip": "SCHEMATICANNON", @@ -1424,7 +1424,7 @@ "item.create.belt_connector.tooltip.summary": "Соединяет _2_ _Вала_ с помощью _механического_ _ремня_._ Соединённые валы будут иметь одинаковые _скорость_ и _направление_ _вращения._ Лента может служить как _конвейер_ для _транспортировки._", "item.create.belt_connector.tooltip.control1": "ПКМ по валу", "item.create.belt_connector.tooltip.action1": "Выбирает вал в качестве одного шкива конвейера. Оба выбранных вала должны быть _на_ _одной_ _линии_ _вертикально,_ _горизонтально_ либо _диагонально_ по направлению конвейера.", - "item.create.belt_connector.tooltip.control2": "ПКМ крадясь", + "item.create.belt_connector.tooltip.control2": "ПКМ крадучись", "item.create.belt_connector.tooltip.action2": "_Сбрасывает_ первый выбранный шкив для конвейера.", "item.create.goggles.tooltip": "GOGGLES", @@ -1438,7 +1438,7 @@ "item.create.wrench.tooltip.summary": "Полезный _инструмент_ для работы с _кинетическими_ штуковинами. Может использоваться для _поворота_, _демонтажа_ и _настройки_ компонентов.", "item.create.wrench.tooltip.control1": "ПКМ по кинетическому блоку", "item.create.wrench.tooltip.action1": "_Поворачивает_ _компонент_ с которым вы взаимодействуете _к_ _лицу_ или _от_ _лица_.", - "item.create.wrench.tooltip.control2": "ПКМ крадясь", + "item.create.wrench.tooltip.control2": "ПКМ крадучись", "item.create.wrench.tooltip.action2": "Разбирает кинетические компоненты и помещает их обратно в ваш инвентарь.", "block.create.creative_motor.tooltip": "CREATIVE MOTOR", @@ -1671,10 +1671,10 @@ "block.create.redstone_link.tooltip": "REDSTONE LINK", "block.create.redstone_link.tooltip.summary": "_Беспроводной_ _передатчик_ сигнала красного камня. Можно выбрать _частоты_ с помощью любого предмета. Диапазон сигнала ограничен, но достаточно далёк.", "block.create.redstone_link.tooltip.condition1": "Когда приведен в действие", - "block.create.redstone_link.tooltip.behaviour1": "Приняв сигнал той-же _частоты_ выдаёт сигнал красного камня или наоборот.", + "block.create.redstone_link.tooltip.behaviour1": "Приняв сигнал той же _частоты_ выдаёт сигнал красного камня или наоборот.", "block.create.redstone_link.tooltip.control1": "При ПКМ предметом", "block.create.redstone_link.tooltip.action1": "Устанавливает частоту для этого предмета. Всего _два_ разных предмета могут быть использованы в комбинации для определения частоты.", - "block.create.redstone_link.tooltip.control2": "ПКМ крадясь", + "block.create.redstone_link.tooltip.control2": "ПКМ крадучись", "block.create.redstone_link.tooltip.action2": "Переключение между режимом _приемника_ и _передатчика_.", "block.create.nixie_tube.tooltip": "NIXIE TUBE", diff --git a/src/main/resources/assets/create/models/item/goggles.json b/src/main/resources/assets/create/models/block/goggles.json similarity index 86% rename from src/main/resources/assets/create/models/item/goggles.json rename to src/main/resources/assets/create/models/block/goggles.json index 5dbe10332..b91727c27 100644 --- a/src/main/resources/assets/create/models/item/goggles.json +++ b/src/main/resources/assets/create/models/block/goggles.json @@ -4,7 +4,7 @@ "textures": { "0": "create:block/brass_casing", "1": "block/black_stained_glass", - "2": "create:item/goggles", + "2": "create:item/goggles_model", "particle": "create:block/brass_casing" }, "elements": [ @@ -13,7 +13,7 @@ "from": [11, 7, 3], "to": [12, 8, 4], "faces": { - "north": {"uv": [11, 0, 12, 1], "texture": "#0"}, + "north": {"uv": [8, 1, 9, 2], "texture": "#0"}, "east": {"uv": [10, 0, 11, 1], "texture": "#0"}, "south": {"uv": [11, 8, 12, 9], "texture": "#0"}, "west": {"uv": [4, 0, 5, 1], "texture": "#0"}, @@ -26,7 +26,7 @@ "from": [4, 7, 3], "to": [5, 8, 4], "faces": { - "north": {"uv": [11, 0, 12, 1], "texture": "#0"}, + "north": {"uv": [14, 1, 15, 2], "texture": "#0"}, "east": {"uv": [10, 0, 11, 1], "texture": "#0"}, "south": {"uv": [11, 8, 12, 9], "texture": "#0"}, "west": {"uv": [4, 0, 5, 1], "texture": "#0"}, @@ -39,11 +39,11 @@ "from": [9, 8, 3], "to": [11, 9, 4], "faces": { - "north": {"uv": [7, 0, 9, 1], "texture": "#0"}, + "north": {"uv": [3, 1, 5, 2], "texture": "#0"}, "east": {"uv": [6, 0, 7, 1], "texture": "#0"}, "south": {"uv": [7, 0, 9, 1], "texture": "#0"}, "west": {"uv": [7, 0, 8, 1], "texture": "#0"}, - "up": {"uv": [7, 1, 9, 2], "texture": "#0"}, + "up": {"uv": [6, 1, 8, 2], "texture": "#0"}, "down": {"uv": [7, 0, 9, 1], "texture": "#0"} } }, @@ -52,7 +52,7 @@ "from": [7, 7, 3], "to": [9, 8, 4], "faces": { - "north": {"uv": [7, 0, 9, 1], "texture": "#0"}, + "north": {"uv": [7, 1, 9, 2], "texture": "#0"}, "east": {"uv": [6, 0, 7, 1], "texture": "#0"}, "south": {"uv": [7, 0, 9, 1], "texture": "#0"}, "west": {"uv": [7, 0, 8, 1], "texture": "#0"}, @@ -66,11 +66,11 @@ "to": [7, 9, 4], "rotation": {"angle": 0, "axis": "y", "origin": [4, 8, 8]}, "faces": { - "north": {"uv": [7, 0, 9, 1], "texture": "#0"}, + "north": {"uv": [10, 1, 12, 2], "texture": "#0"}, "east": {"uv": [6, 0, 7, 1], "texture": "#0"}, "south": {"uv": [7, 0, 9, 1], "texture": "#0"}, "west": {"uv": [7, 0, 8, 1], "texture": "#0"}, - "up": {"uv": [12, 1, 14, 2], "texture": "#0"}, + "up": {"uv": [10, 1, 12, 2], "texture": "#0"}, "down": {"uv": [7, 0, 9, 1], "texture": "#0"} } }, @@ -79,7 +79,7 @@ "from": [9, 6, 3], "to": [11, 7, 4], "faces": { - "north": {"uv": [7, 0, 9, 1], "texture": "#0"}, + "north": {"uv": [13, 14, 15, 15], "texture": "#0"}, "east": {"uv": [6, 0, 7, 1], "texture": "#0"}, "south": {"uv": [7, 0, 9, 1], "texture": "#0"}, "west": {"uv": [7, 0, 8, 1], "texture": "#0"}, @@ -93,7 +93,7 @@ "to": [7, 7, 4], "rotation": {"angle": 0, "axis": "y", "origin": [4, 8, 8]}, "faces": { - "north": {"uv": [7, 0, 9, 1], "texture": "#0"}, + "north": {"uv": [13, 14, 15, 15], "texture": "#0"}, "east": {"uv": [6, 0, 7, 1], "texture": "#0"}, "south": {"uv": [7, 0, 9, 1], "texture": "#0"}, "west": {"uv": [7, 0, 8, 1], "texture": "#0"}, @@ -103,8 +103,9 @@ }, { "name": "glass", - "from": [5, 7, 3.5], - "to": [11, 8, 3.5], + "from": [5, 7, 3.3], + "to": [11, 8, 3.3], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 7.8]}, "faces": { "north": {"uv": [1, 0, 7, 1], "texture": "#1"}, "east": {"uv": [11, 0, 11.2, 1], "texture": "#1"}, diff --git a/src/main/resources/assets/create/models/block/sticker/block.json b/src/main/resources/assets/create/models/block/sticker/block.json new file mode 100644 index 000000000..1ece065f4 --- /dev/null +++ b/src/main/resources/assets/create/models/block/sticker/block.json @@ -0,0 +1,71 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "block/piston_bottom", + "1": "block/piston_inner", + "3": "create:block/sticker", + "4": "create:block/sticker_side", + "particle": "block/piston_bottom" + }, + "elements": [ + { + "from": [0, 0, 0], + "to": [16, 8, 16], + "faces": { + "north": {"uv": [0, 8, 16, 16], "texture": "#4"}, + "east": {"uv": [0, 8, 16, 16], "texture": "#4"}, + "south": {"uv": [0, 8, 16, 16], "texture": "#4"}, + "west": {"uv": [0, 8, 16, 16], "texture": "#4"}, + "up": {"uv": [0, 0, 16, 16], "texture": "#1"}, + "down": {"uv": [0, 0, 16, 16], "texture": "#0"} + } + }, + { + "from": [0, 8, 0], + "to": [16, 16, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 16, 8]}, + "faces": { + "north": {"uv": [0, 0, 16, 8], "texture": "#4"}, + "east": {"uv": [0, 0, 16, 8], "texture": "#4"}, + "south": {"uv": [0, 0, 16, 8], "texture": "#4"}, + "west": {"uv": [0, 0, 16, 8], "texture": "#4"}, + "up": {"uv": [0, 0, 8, 8], "texture": "#3"} + } + }, + { + "from": [0, 8, -0.95], + "to": [16, 16, 0.05], + "faces": { + "south": {"uv": [0, 0, 16, 8], "texture": "#4"} + } + }, + { + "from": [0, 8, 15.95], + "to": [16, 16, 16.95], + "faces": { + "north": {"uv": [0, 0, 16, 8], "texture": "#4"} + } + }, + { + "from": [15.95, 8, 0], + "to": [16.95, 16, 16], + "faces": { + "west": {"uv": [0, 0, 16, 8], "texture": "#4"} + } + }, + { + "from": [-0.95, 8, 0], + "to": [0.05, 16, 16], + "faces": { + "east": {"uv": [16, 0, 0, 8], "texture": "#4"} + } + } + ], + "groups": [ + { + "name": "Piston Block", + "origin": [8, 8, 8], + "children": [0, 1, 2, 3, 4, 5] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/sticker/block_powered.json b/src/main/resources/assets/create/models/block/sticker/block_powered.json new file mode 100644 index 000000000..ee3244b46 --- /dev/null +++ b/src/main/resources/assets/create/models/block/sticker/block_powered.json @@ -0,0 +1,6 @@ +{ + "parent": "create:block/sticker/block", + "textures": { + "4": "create:block/sticker_side_powered" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/sticker/head.json b/src/main/resources/assets/create/models/block/sticker/head.json new file mode 100644 index 000000000..b2b808c18 --- /dev/null +++ b/src/main/resources/assets/create/models/block/sticker/head.json @@ -0,0 +1,41 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "2": "block/piston_side", + "3": "create:block/sticker", + "particle": "block/piston_bottom" + }, + "elements": [ + { + "from": [1, 8, 1], + "to": [15, 13, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [9, 16, 9]}, + "faces": { + "north": {"uv": [8.5, 0, 15.5, 2.5], "texture": "#3"}, + "east": {"uv": [8.5, 0, 15.5, 2.5], "texture": "#3"}, + "south": {"uv": [8.5, 0, 15.5, 2.5], "texture": "#3"}, + "west": {"uv": [8.5, 0, 15.5, 2.5], "texture": "#3"}, + "up": {"uv": [8.5, 8.5, 15.5, 15.5], "texture": "#3"}, + "down": {"uv": [0.5, 8.5, 7.5, 15.5], "texture": "#3"} + } + }, + { + "from": [6, 3, 6], + "to": [10, 8, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [14, 11, 14]}, + "faces": { + "north": {"uv": [0, 0, 5, 4], "rotation": 90, "texture": "#2"}, + "east": {"uv": [0, 0, 5, 4], "rotation": 90, "texture": "#2"}, + "south": {"uv": [0, 0, 5, 4], "rotation": 90, "texture": "#2"}, + "west": {"uv": [0, 0, 5, 4], "rotation": 90, "texture": "#2"} + } + } + ], + "groups": [ + { + "name": "Piston Head", + "origin": [14, 28, 14], + "children": [0, 1] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/sticker/item.json b/src/main/resources/assets/create/models/block/sticker/item.json new file mode 100644 index 000000000..c8c48ec47 --- /dev/null +++ b/src/main/resources/assets/create/models/block/sticker/item.json @@ -0,0 +1,104 @@ +{ + "credit": "Made with Blockbench", + "parent": "block/block", + "textures": { + "0": "block/piston_bottom", + "1": "block/piston_inner", + "2": "block/piston_side", + "3": "create:block/sticker", + "4": "create:block/sticker_side", + "particle": "block/piston_bottom" + }, + "elements": [ + { + "from": [0, 0, 0], + "to": [16, 8, 16], + "faces": { + "north": {"uv": [0, 8, 16, 16], "texture": "#4"}, + "east": {"uv": [0, 8, 16, 16], "texture": "#4"}, + "south": {"uv": [0, 8, 16, 16], "texture": "#4"}, + "west": {"uv": [0, 8, 16, 16], "texture": "#4"}, + "up": {"uv": [0, 0, 16, 16], "texture": "#1"}, + "down": {"uv": [0, 0, 16, 16], "texture": "#0"} + } + }, + { + "from": [0, 8, 0], + "to": [16, 16, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 16, 8]}, + "faces": { + "north": {"uv": [0, 0, 16, 8], "texture": "#4"}, + "east": {"uv": [0, 0, 16, 8], "texture": "#4"}, + "south": {"uv": [0, 0, 16, 8], "texture": "#4"}, + "west": {"uv": [0, 0, 16, 8], "texture": "#4"}, + "up": {"uv": [0, 0, 8, 8], "texture": "#3"} + } + }, + { + "from": [0, 8, -0.95], + "to": [16, 16, 0.05], + "faces": { + "south": {"uv": [0, 0, 16, 8], "texture": "#4"} + } + }, + { + "from": [0, 8, 15.95], + "to": [16, 16, 16.95], + "faces": { + "north": {"uv": [0, 0, 16, 8], "texture": "#4"} + } + }, + { + "from": [16, 8, 0.05], + "to": [17, 16, 16.05], + "rotation": {"angle": 0, "axis": "y", "origin": [9, 8, 8]}, + "faces": { + "west": {"uv": [0, 0, 16, 8], "texture": "#4"} + } + }, + { + "from": [-1, 8, -0.05], + "to": [0, 16, 15.95], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 8, 8]}, + "faces": { + "east": {"uv": [0, 0, 16, 8], "texture": "#4"} + } + }, + { + "from": [1, 9, 1], + "to": [15, 14, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [9, 17, 9]}, + "faces": { + "north": {"uv": [8.5, 0, 15.5, 2.5], "texture": "#3"}, + "east": {"uv": [8.5, 0, 15.5, 2.5], "texture": "#3"}, + "south": {"uv": [8.5, 0, 15.5, 2.5], "texture": "#3"}, + "west": {"uv": [8.5, 0, 15.5, 2.5], "texture": "#3"}, + "up": {"uv": [8.5, 8.5, 15.5, 15.5], "texture": "#3"}, + "down": {"uv": [0.5, 8.5, 7.5, 15.5], "texture": "#3"} + } + }, + { + "from": [6, 4, 6], + "to": [10, 9, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [14, 12, 14]}, + "faces": { + "north": {"uv": [0, 0, 5, 4], "rotation": 90, "texture": "#2"}, + "east": {"uv": [0, 0, 5, 4], "rotation": 90, "texture": "#2"}, + "south": {"uv": [0, 0, 5, 4], "rotation": 90, "texture": "#2"}, + "west": {"uv": [0, 0, 5, 4], "rotation": 90, "texture": "#2"} + } + } + ], + "groups": [ + { + "name": "Piston Block", + "origin": [8, 8, 8], + "children": [0, 1, 2, 3, 4, 5] + }, + { + "name": "Piston Head", + "origin": [14, 28, 14], + "children": [6, 7] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/sticker/sticker.bbmodel b/src/main/resources/assets/create/models/block/sticker/sticker.bbmodel new file mode 100644 index 000000000..0a341360e --- /dev/null +++ b/src/main/resources/assets/create/models/block/sticker/sticker.bbmodel @@ -0,0 +1 @@ +{"meta":{"format_version":"3.6","creation_time":1614729493,"model_format":"java_block","box_uv":false},"name":"","parent":"","ambientocclusion":true,"front_gui_light":false,"visible_box":[1,1,0],"resolution":{"width":16,"height":16},"elements":[{"name":"cube","from":[0,0,0],"to":[16,8,16],"autouv":0,"color":6,"locked":false,"origin":[8,8,8],"faces":{"north":{"uv":[0,8,16,16],"texture":4},"east":{"uv":[0,8,16,16],"texture":4},"south":{"uv":[0,8,16,16],"texture":4},"west":{"uv":[0,8,16,16],"texture":4},"up":{"uv":[0,0,16,16],"texture":1},"down":{"uv":[0,0,16,16],"texture":0}},"uuid":"9189c687-ec3f-0483-bb94-8eb1610bb0f7"},{"name":"cube","from":[0,8,0],"to":[16,16,16],"autouv":0,"color":6,"locked":false,"origin":[8,16,8],"faces":{"north":{"uv":[0,0,16,8],"texture":4},"east":{"uv":[0,0,16,8],"texture":4},"south":{"uv":[0,0,16,8],"texture":4},"west":{"uv":[0,0,16,8],"texture":4},"up":{"uv":[0,0,8,8],"texture":3},"down":{"uv":[0,0,0,0],"texture":null}},"uuid":"c915a8a9-e0c7-0d13-5267-953429b366f5"},{"name":"cube","from":[1,12,1],"to":[15,17,15],"autouv":0,"color":1,"locked":false,"origin":[9,20,9],"faces":{"north":{"uv":[8.5,0,15.5,2.5],"texture":3},"east":{"uv":[8.5,0,15.5,2.5],"texture":3},"south":{"uv":[8.5,0,15.5,2.5],"texture":3},"west":{"uv":[8.5,0,15.5,2.5],"texture":3},"up":{"uv":[8.5,8.5,15.5,15.5],"texture":3},"down":{"uv":[0.5,8.5,7.5,15.5],"texture":3}},"uuid":"838bfc74-3754-755e-97b9-dc8f49cb4cc4"},{"name":"cube","from":[6,7,6],"to":[10,12,10],"autouv":0,"color":6,"locked":false,"origin":[14,15,14],"faces":{"north":{"uv":[0,0,5,4],"rotation":90,"texture":2},"east":{"uv":[0,0,5,4],"rotation":90,"texture":2},"south":{"uv":[0,0,5,4],"rotation":90,"texture":2},"west":{"uv":[0,0,5,4],"rotation":90,"texture":2},"up":{"uv":[0,0,4,4],"texture":null},"down":{"uv":[0,0,4,4],"texture":null}},"uuid":"e380ceaa-57a4-7e47-45d8-238ff048b7cd"}],"outliner":[{"name":"Piston Block","origin":[8,8,8],"uuid":"d35280bd-4aab-971b-e553-24b5af733d45","export":true,"isOpen":false,"locked":false,"visibility":true,"autouv":0,"children":["9189c687-ec3f-0483-bb94-8eb1610bb0f7","c915a8a9-e0c7-0d13-5267-953429b366f5"]},{"name":"Piston Head","origin":[14,28,14],"uuid":"6c824c11-53c5-d20a-8857-1867915ba892","export":true,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["838bfc74-3754-755e-97b9-dc8f49cb4cc4","e380ceaa-57a4-7e47-45d8-238ff048b7cd"]}],"textures":[{"path":"F:\\Create\\Attacher\\Sticker Textures\\piston_bottom.png","name":"piston_bottom.png","folder":"Sticker Textures","namespace":"","id":"0","particle":true,"visible":true,"mode":"bitmap","saved":true,"uuid":"fd815e7a-cd5f-a1d8-9ed5-64cee6940ea0","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABZUlEQVQ4T4VTsYqDQBRcm1RGqyMgyRVBAlbCGdsjET/Y0s6QxibcBwSrMwjhKo2Vjce8u9HVC9xrdnk7Ozvz3lsjjuNe/UZd17Lruk7WxWKhbNvm8Z8VeAME9nKp3vZ7ATRNIysOv+535e52wx75l9VKSC3LUlmWKSMMwz6KIkmQoLheZa+Dy7IUQuY3m81IEASBsPJVXASAAVUg1dUAUxTFj4LX9XoAAwTw++Gg2rYVS7w8V/l5uynD9/3e3W4n0ngJr0A2Vs/zBFNV1aB0QoCX8YJpmhMQlDCgiLUAaZ7nYxdI8KwLjuOInXkhJwSsuN7CZzm9kGIBc3A8HtXH5SJe2SrOBfIMXSUKWz8eIwFAJOGg6HMxby2wAwHmAAWceySR3krd4mDBdV1RCfmQjk6cT6eJJU4gcbCTpunYBRzQ91w6lbAetJMkyTiJ+txDMsda/xMo3NPPBBC+ML4v4r8vrGO+ARsXKQWAtEm4AAAAAElFTkSuQmCC"},{"path":"F:\\Create\\Attacher\\Sticker Textures\\piston_inner.png","name":"piston_inner.png","folder":"Sticker Textures","namespace":"","id":"1","particle":false,"visible":true,"mode":"bitmap","saved":true,"uuid":"b94d7326-7db9-4e58-dfb6-169b5ecac9fd","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABs0lEQVQ4T4VTsWoCQRR81wiCelW00QhyCFZK1MImqFj4E8HfEC0sRPE3JD9gaaeksZFgLYdgFCGmOhUUG8O85D3vYkK22b13s7PzZmeNSqVyoe/hOI4sdTZN86bmxhsgMINBesjluL7b7XgG2cf7O1nJpK5Rv4tECKShUIhGoxEZ+Xz+Ui6XuSAEstkNXq1WTCgksVjsSpDNZplVNgIkioTUns89akBu2/aXgvtoVPuEZIAfi0U6HA4kJ6PuVgnM23pNRjqdvliJBPeGAWmBQIDC4TD5/X4lXi6XvN5sNqpUCQqFws3mXq/ncb9er9NisVBFOHAymRDfgmVZ7AEGpD3VatRqtfjb5/Px3Gw2aTgceoxUAlyjOA4jq9UqdTodVXA6najdbtNzv+8xkluAglKpRK/TKW+AWZlMhrrdrqeFRqNBs9mMjURWoNTZ768EQIMESlKpFMXjcSU4Ho+03W75VmQAqwTIAZh/hkUSJydCnTul2gJMxEDSECBc48t4zGokfZJAwYEMpupb+Ct97jiLT6ghL4PB4JpENxCS3bGWfzDu18eE08/ns975f08YeMF8ApBNGgW9XdHyAAAAAElFTkSuQmCC"},{"path":"F:\\Create\\Attacher\\Sticker Textures\\piston_side.png","name":"piston_side.png","folder":"Sticker Textures","namespace":"","id":"2","particle":false,"visible":true,"mode":"bitmap","saved":true,"uuid":"db3f52e8-b2d3-9368-ac4d-62cc93c62134","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB0ElEQVQ4T4VSwWoaURQ9A8WmzTg2NNFENIIdEl0UIcZFFw2R+An5gf6BX+GfuHfpJijtQkiiELqx0iyMIlHTwowGEglMOc/c8U0J5G7evHvvnHvOeddot9tet9tFbHYGxgfrvToZxv43SE3Ps/bL+4JMJgOjWq16/X4fn0MXuJ062N6K+ADuzimk5icBvDM3cP7XRiqVglGpVLzJZILc5rXeg821N/i5KIC1k0Tfr909PKnvq7tPiEajMMrlssfE4/AHPlrrAZC5daDuptvBH/c+UHub+LqUWSqVFADDcRx1LhYLdYZCIUQiK0kBhOd+I5fLeXY6rWpbsRiSySRc18XvXk/dp+OxOrPZrOoZjUZqEPM3wyF8AHtvD5ZlwTTNQNPR8bE/eD6fYzAY+KCtVmspIRIOQwA4XeRwCvPxeBz6z8I2AECaolcovpQjYEACGRSLRXQuL33NnHBweKiYMC+hs6RHzmy2lEAAaZap9IOhG0qDJQjsA+TzeWWgGCQaKYl5ASED3R/1CmRg27Yq0DRS50t8bzYDkgRU+ghWr9dXr6Dr/p+6MBE/ZF9qtRqMQqHg7SYSappOWZzW5chySV+j0VgCsInry9VlvLa+es8/A5wUOjLC82gAAAAASUVORK5CYII="},{"path":"F:\\Create\\Attacher\\Sticker Textures\\sticker.png","name":"sticker.png","folder":"Sticker Textures","namespace":"","id":"3","particle":false,"visible":true,"mode":"bitmap","saved":true,"uuid":"d37f6ff6-f6ff-f4aa-4402-5bccef23d620","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADh0lEQVRYR+1XPUxTURQ+TQu8wiu00ECJCkaJxhgwymRAY4IDYTNGBxiMJG4OEBclcTJBFwODmwmGAQYd3AiLiTEqgwECLtVUtETTgi0t5UEf8sgz3ymneW35Tetgwlneve/de853v3v+nu35wBNzYnaWhl6M2ugA0n2707zY1ER3eu/bOl+2mYpaQh7Vty8NMS1MurZOozff2GxQdFDjYkX2Tk5Omg8/PCBfg4NBKKpCuqbzMhir9fpI14kUhSgUCVM4YNCjlsfU3NxsO9CpdzreyMiIGQwG6b36lty+TV4WD9vZiN/vp5HocMb7Vu0K1dfXU1dXV2EA9Pf3m4uLi3TO+428ioMBOFUPLbjaCMAaiz/xPKnFKKIbNBM5SdXV1dTX11cYAD09PSaMqompNEnRxCodu3CdACz7fcnRS7xucHCwMAD25Xk7LCqIDxwCOGTgkIH/m4FCFKO8GChEOc4LQD6bC7GXU7FUs/aGGOtMbqyRs6iUphKneX7GOZ2qcEWl/BwPeNLVDPO8GhIoQDUrT0ywcl9lyojTrXLZhKDMiiTjGg+/Gue4mmHcPdZhSiMi61R7BQ+1zWXCGE8RNCtoVIY6xlLVcPzZLfPjlJ+utpzlNWvJVFORNrrFiMznfszTieN11H53mPffe9dtoguKL0XJ2NgkR5Gd1NIyMowMNemJdExPLw+lALweuGGGfkVYKejfTXANofgSucsUutb7Kg2AT7uaoJWVGNX66tMqcFKwEwoH+R2+5QAAA1Ba665kAAADwTVAhPbaI172AzCAsRWAKIVBiDSo6APJodD3wBeSxnVHBqAUMv15ns431mUQAVDyXdiyXoG3ooZ+/p4jpbgsYx8DIOKmVARrI8sLlL4CaxQIAzAWX03tAt0Y4wkGsqNAfECcCy239RqsiPQ/q+SurOKueV8AQD/ACAN7AbDeNQyLD1hBbHsFOKHVB4Ru2SgMYC5gsp0ww4iSSTuAwQecxa5cBrKjQJwwvLTGeUGcUa5guyiQMMz2AWFBwME5c3wAAKwM7BWG20bB1omzo0B0ye+Yy+Uhb1U5O2XaB6xhyGGXlXhESanTzklqtzCEkyEZqWXlnBfwxDuIJKkcJ0QqRrqFw4Fua7rFxlOOmRxSdkzFhp76D1QVIkMntaSGtPUFzgWY45mTirPDENasxai1JkDRxAqD2C4K8i5Gu935v/72F6SUUT/55o1qAAAAAElFTkSuQmCC"},{"path":"F:\\Create\\Attacher\\Sticker Textures\\sticker_side.png","name":"sticker_side.png","folder":"Sticker Textures","namespace":"","id":"4","particle":false,"visible":true,"mode":"bitmap","saved":true,"uuid":"b6008321-379a-f043-b8b9-8285c50d2ce8","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACGElEQVQ4T5WSS2gTYRSFz2wCgUxSayeToqMRxyqEPDQmqEVtJAgKAdfuFFxLcdOFIqKLbkRcC3YhuHXXneKDGghJGwYC2o5IOjHNODU2j1VARu4t/zStQfSufube8537GOn+3G3Xsh08X3gp4T/i5o3rrqYqkF69WHA3N220fji49+jxP0Ee3r3jRvYrmJhQIRHpZ28L++QxEPHB/NO/Qp49mXeLhgGh4Q6qtSrelpZx9LCGs4kEbs3OjYSIcb/ULcxkTyEVS0Ei4uLSe56+3e4xZFQnwpnE4+My11+dvgBp7xIvXjrvEuTIgUlvJzTz128bIPG7Nx+4O2+Jo64wDKHiveI/AIa5xu0L+vHYCTeiKjwOBTm3bAefa5/YnQxojIR+bOeMDXsDi68/smAwGODalRleEp2YckvlmveXTJ+O4aA6ufuMva0BdF2HpmnodruoVCo4pIVZtG59R6FQ4Hez2eScPObj00vJZNJVFAXpdBrBYBCBQICLOp0OTNNkkRD3+31YlgXHttHp9eA4DqR8Pu+GZBn61BQDyH37pG12oiB4NBr1xPRNUVUUi8UdAH0IhUIsIPdSqYTLxgqMXxJaJ1PIZrPsTEaUp/d6o7ENyOVyWC6XmUoJPl29jshKFWuQED53BpFweFeX5uoqj+EBSCQg1Inowu/3Ix6PM5QWLIJqGZDJZFxxOp/Px3kxilc99CDwcM1vBi4whPcwgQ8AAAAASUVORK5CYII="},{"path":"F:\\Create\\Attacher\\Sticker Textures\\sticker_side_powered.png","name":"sticker_side_powered.png","folder":"Sticker Textures","namespace":"","id":"5","particle":false,"visible":true,"mode":"bitmap","saved":true,"uuid":"1c9b6770-8e6d-ef0b-3c7b-a3e4be8da6a6","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACNElEQVQ4T5WSTWgTYRCG3zU0EM2P/Vk2NQaRNo00mLQmESVoG81FTzl7U+hZxEsPFhE99CIiHgv2IHj11ptilTQQQlujQZO2iEmadtk0Nj8ohMavzJTd1hpEv9O338z7zDszK92fvC2Kqobnsy8l/Me5dfOGcCsypFcvZkWlomJzS8PUo8f/BHl4765w9sro61MgEel7YxvdtuMg4oPpp3+FzDyZFslMBrqGHSxnl/E2tYiBU25c9PsxcWeyI0Rvd+1bEePnz2HENwKJiHOJd9x9tdpgSCcnemUS9/TYOP965DKkw0Mcu3JJEOS0q9+YCfX8dX0DJJ5/857dGUPstIWDEEo+LP4DkFldYfs63es7I5yKzO3QocqbqoZc9gtXpwLUhn/Qs7/GkrqBudcLLGi1WohfG+ch0Yoplkhnjb8kEvLhpNL/+xrbWz9xwuuF2+1GvV7H51QKAy55z8G6hqvxON/L5TLHTL0WXr0UCASELMsIBoOw2+2wWq2cVKvVUM7lWKSLm80misUiNFVFrdGApmmQYrGYcNhsGBwaYgBVp9NWVSSWlvgeGR1Ft8djiOlNVhQkk8l9AD04HA4WSJUK5tNpLHz4hKwkMOE/i7FQCCvVKhcid+SiUCrtAaLRKBbTaaZSwLqzg3yhgJnMR6wd+YVn4QtwyTKcw8OGy9V8ntswAFRZh5AT3cUxiwUhnw/bXV08YP1QLgPC4bDQV2c2mzmut3K03ebvHyaTIST7B3N2AQhkNoSNVX+GAAAAAElFTkSuQmCC"}]} \ No newline at end of file diff --git a/src/main/resources/assets/create/shader/flap.vert b/src/main/resources/assets/create/shader/flap.vert new file mode 100644 index 000000000..bd982595d --- /dev/null +++ b/src/main/resources/assets/create/shader/flap.vert @@ -0,0 +1,104 @@ +#version 110 +#define PI 3.1415926538 + +attribute vec3 aPos; +attribute vec3 aNormal; +attribute vec2 aTexCoords; + +attribute vec3 aInstancePos; +attribute vec2 aLight; + +attribute vec3 aSegmentOffset; +attribute vec3 aPivot; +attribute float aHorizontalAngle; +attribute float aIntensity; +attribute float aFlapScale; + +attribute float aFlapness; + +// outputs +varying vec2 TexCoords; +varying vec4 Color; +varying float Diffuse; +varying vec2 Light; + +#if defined(CONTRAPTION) +varying vec3 BoxCoord; + +uniform vec3 uLightBoxSize; +uniform vec3 uLightBoxMin; +uniform mat4 uModel; +#endif + +uniform float uTime; +uniform mat4 uViewProjection; +uniform int uDebug; + +uniform vec3 uCameraPos; +varying float FragDistance; + +float diffuse(vec3 normal) { + float x = normal.x; + float y = normal.y; + float z = normal.z; + return min(x * x * .6 + y * y * ((3. + y) / 4.) + z * z * .8, 1.); +} + +mat4 rotate(vec3 axis, float angle) { + float s = sin(angle); + float c = cos(angle); + float oc = 1. - c; + + return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0., + oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0., + oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0., + 0., 0., 0., 1.); +} + +float toRad(float degrees) { + return fract(degrees / 360.) * PI * 2.; +} + +float getFlapAngle() { + float absFlap = abs(aFlapness); + + float angle = sin((1. - absFlap) * PI * aIntensity) * 30. * aFlapness * aFlapScale; + + float halfAngle = angle * 0.5; + + float which = step(0., aFlapness); + float degrees = which * halfAngle + (1. - which) * angle; // branchless conditional multiply + + return -toRad(degrees); +} + +void main() { + float flapAngle = getFlapAngle(); + + mat4 orientation = rotate(vec3(0., 1., 0.), toRad(aHorizontalAngle)); + mat4 flapRotation = rotate(vec3(1., 0., 0.), flapAngle); + + vec4 worldPos = flapRotation * vec4(aPos - aPivot, 1.) + vec4(aPivot + aSegmentOffset, 0.); + worldPos = orientation * vec4(worldPos.xyz - .5, 1.) + vec4(aInstancePos + .5, 0.); + + #ifdef CONTRAPTION + worldPos = uModel * worldPos; + mat4 normalMat = uModel * orientation * flapRotation; + + BoxCoord = (worldPos.xyz - uLightBoxMin) / uLightBoxSize; + FragDistance = length(worldPos.xyz); + #else + mat4 normalMat = orientation * flapRotation; + + FragDistance = length(worldPos.xyz - uCameraPos); + #endif + + vec3 norm = normalize(normalMat * vec4(aNormal, 0.)).xyz; + + Diffuse = diffuse(norm); + TexCoords = aTexCoords; + Light = aLight; + gl_Position = uViewProjection * worldPos; + + Color = vec4(1.); +} diff --git a/src/main/resources/assets/create/textures/block/sticker.png b/src/main/resources/assets/create/textures/block/sticker.png new file mode 100644 index 000000000..75429c8af Binary files /dev/null and b/src/main/resources/assets/create/textures/block/sticker.png differ diff --git a/src/main/resources/assets/create/textures/block/sticker_side.png b/src/main/resources/assets/create/textures/block/sticker_side.png new file mode 100644 index 000000000..4e82caf62 Binary files /dev/null and b/src/main/resources/assets/create/textures/block/sticker_side.png differ diff --git a/src/main/resources/assets/create/textures/block/sticker_side_powered.png b/src/main/resources/assets/create/textures/block/sticker_side_powered.png new file mode 100644 index 000000000..04a2c1e23 Binary files /dev/null and b/src/main/resources/assets/create/textures/block/sticker_side_powered.png differ diff --git a/src/main/resources/assets/create/textures/item/builders_tea.png b/src/main/resources/assets/create/textures/item/builders_tea.png index 574284067..55870a490 100644 Binary files a/src/main/resources/assets/create/textures/item/builders_tea.png and b/src/main/resources/assets/create/textures/item/builders_tea.png differ diff --git a/src/main/resources/assets/create/textures/item/chocolate_glazed_berries.png b/src/main/resources/assets/create/textures/item/chocolate_glazed_berries.png new file mode 100644 index 000000000..29e0f3c16 Binary files /dev/null and b/src/main/resources/assets/create/textures/item/chocolate_glazed_berries.png differ diff --git a/src/main/resources/assets/create/textures/item/cinder_flour.png b/src/main/resources/assets/create/textures/item/cinder_flour.png index ed2e5d297..d5b757e94 100644 Binary files a/src/main/resources/assets/create/textures/item/cinder_flour.png and b/src/main/resources/assets/create/textures/item/cinder_flour.png differ diff --git a/src/main/resources/assets/create/textures/item/goggles.png b/src/main/resources/assets/create/textures/item/goggles.png index bf6467f88..278ad9090 100644 Binary files a/src/main/resources/assets/create/textures/item/goggles.png and b/src/main/resources/assets/create/textures/item/goggles.png differ diff --git a/src/main/resources/assets/create/textures/item/goggles_model.png b/src/main/resources/assets/create/textures/item/goggles_model.png new file mode 100644 index 000000000..bf6467f88 Binary files /dev/null and b/src/main/resources/assets/create/textures/item/goggles_model.png differ diff --git a/src/main/resources/assets/create/textures/item/honeyed_apple.png b/src/main/resources/assets/create/textures/item/honeyed_apple.png new file mode 100644 index 000000000..39311123e Binary files /dev/null and b/src/main/resources/assets/create/textures/item/honeyed_apple.png differ diff --git a/src/main/resources/assets/create/textures/item/sweet_roll.png b/src/main/resources/assets/create/textures/item/sweet_roll.png new file mode 100644 index 000000000..7fdf41754 Binary files /dev/null and b/src/main/resources/assets/create/textures/item/sweet_roll.png differ diff --git a/src/main/resources/create.mixins.json b/src/main/resources/create.mixins.json index e9d682678..6956226de 100644 --- a/src/main/resources/create.mixins.json +++ b/src/main/resources/create.mixins.json @@ -9,7 +9,8 @@ "CancelTileEntityRenderMixin", "LightUpdateMixin", "RenderHooksMixin", - "FogColorTrackerMixin" + "FogColorTrackerMixin", + "NetworkLightUpdateMixin" ], "injectors": { "defaultRequire": 1