SoundScapes, Part I

- Sounds for depots, funnels, cogwheels and generic kinetic rumbling, also fans
This commit is contained in:
simibubi 2021-04-20 02:19:12 +02:00
parent 9697a30d76
commit 9391700c26
32 changed files with 747 additions and 101 deletions

View file

@ -407,19 +407,19 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j
7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json
b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json
97e9ee471ea650f6b7f3d3f39f00201cd5ad752d assets/create/lang/en_ud.json
3878d0d84b9575728bd299385af2a61bd3a84243 assets/create/lang/en_us.json
33296621c4421a2dc329a3739d8efafbb3b5b57a assets/create/lang/unfinished/de_de.json
052248ce9880cb3db937fed06c6d46a3ca77d1b4 assets/create/lang/unfinished/es_es.json
05d9d186ad4888c2dcb1eb08fe9b78e1e5482cd7 assets/create/lang/unfinished/es_mx.json
dea56d5fcda7baf23d5938b43c1770b5cd76c6f6 assets/create/lang/unfinished/fr_fr.json
56513c7dd8f8ce309b0f77019a2b1b0a55c0cf38 assets/create/lang/unfinished/it_it.json
888191ed07af611597d5ff852ca3d6cb6bf803b7 assets/create/lang/unfinished/ja_jp.json
95fcbeeffd2ced25371f86c9529d4108bf26f930 assets/create/lang/unfinished/ko_kr.json
03e170a7196c4c76942e8b6fde2b0a0b9b877113 assets/create/lang/unfinished/nl_nl.json
a1e092ee4a6eb19568f36535f183afe1d326f0cf assets/create/lang/unfinished/pt_br.json
74b3356506bdb4bf7046768bd7735fa95057d61a assets/create/lang/unfinished/ru_ru.json
ce16cef5a488c2f86def742ca2e436cb42e18552 assets/create/lang/unfinished/zh_cn.json
b55d5abac95ba2649f656857f54b39f98e686767 assets/create/lang/unfinished/zh_tw.json
af76eb706726692eaf7f9f50f40c9278a10c539d assets/create/lang/en_us.json
ec771f0345e4148458035ec8cd4bffc480b45f47 assets/create/lang/unfinished/de_de.json
8ff19eddb1cbf42e3f16abc3968b7554b45d0769 assets/create/lang/unfinished/es_es.json
d7b6c821789f32ed7c4324bb17502cf75ee8b219 assets/create/lang/unfinished/es_mx.json
f4fd19eb4e2d60947b675efe7bc9b27dc7036cd4 assets/create/lang/unfinished/fr_fr.json
c219fafeb713fb4e13a5c1c5fa6a0268fe35cc5f assets/create/lang/unfinished/it_it.json
c44d961f8bb66645257d03dd1f44447cc529cf7b assets/create/lang/unfinished/ja_jp.json
723457b7ff8a06e3d50870e33fa0e5a0db16f9a6 assets/create/lang/unfinished/ko_kr.json
32bffbc8b9b6d02793aaa7328de2ca7c178d87dc assets/create/lang/unfinished/nl_nl.json
27a2d533fa7be9e9e982a1c4b93bb0e5c01e6bf0 assets/create/lang/unfinished/pt_br.json
878bab030e26e6c26fdd5199284aa23d2fb79cc5 assets/create/lang/unfinished/ru_ru.json
7648680dd52bb8f0ba04de23038c0530d37fe7fc assets/create/lang/unfinished/zh_cn.json
624b2a537ee44a2493806414a512805a5683d155 assets/create/lang/unfinished/zh_tw.json
487a511a01b2a4531fb672f917922312db78f958 assets/create/models/block/acacia_window.json
b48060cba1a382f373a05bf0039054053eccf076 assets/create/models/block/acacia_window_pane_noside.json
3066db1bf03cffa1a9c7fbacf47ae586632f4eb3 assets/create/models/block/acacia_window_pane_noside_alt.json
@ -1648,7 +1648,7 @@ d080b1b25e5bc8baf5aee68691b08c7f12ece3b0 assets/create/models/item/windmill_bear
866fbb0ce2878a73e0440d1caf6534c8bd7c384f assets/create/models/item/zinc_ingot.json
a80fb25a0b655e76be986b5b49fcb0f03461a1ab assets/create/models/item/zinc_nugget.json
b1689617190c05ef34bd18456b0c7ae09bb3210f assets/create/models/item/zinc_ore.json
f98bf9f870ac5ee5b31c12a20739773c5fee4949 assets/create/sounds.json
736b2475009be0a214894aad0a42cc2760d2f982 assets/create/sounds.json
5d0cc4c0255dc241e61c173b31ddca70c88d08e4 data/create/advancements/aesthetics.json
187921fa131b06721bfaf63f2623a28c141aae9a data/create/advancements/andesite_alloy.json
0ea2db7173b5be28b289ea7c9a6a0cf5805c60c7 data/create/advancements/andesite_casing.json

View file

@ -1152,15 +1152,19 @@
"_": "->------------------------] Subtitles [------------------------<-",
"create.subtitle.schematicannon_launch_block": "Schematicannon fires",
"create.subtitle.schematicannon_finish": "Schematicannon dings",
"create.subtitle.cogs": "Cogwheels rumble",
"create.subtitle.slime_added": "Slime squishes",
"create.subtitle.mechanical_press_activation_belt": "Mechanical Press bonks",
"create.subtitle.mechanical_press_activation": "Mechanical Press clangs",
"create.subtitle.blockzapper_deny": "Declining boop",
"create.subtitle.blockzapper_confirm": "Affirmative ding",
"create.subtitle.depot_slide": "Item slides",
"create.subtitle.blockzapper_place": "Blockzapper zaps",
"create.subtitle.blaze_munch": "Blaze Burner munches",
"create.subtitle.schematicannon_launch_block": "Schematicannon fires",
"create.subtitle.funnel_flap": "Funnel Flaps",
"create.subtitle.schematicannon_finish": "Schematicannon dings",
"create.subtitle.mechanical_press_activation": "Mechanical Press clangs",
"create.subtitle.blockzapper_deny": "Declining boop",
"create.subtitle.depot_plop": "Item lands",
"_": "->------------------------] Item Descriptions [------------------------<-",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 914",
"_": "Missing Localizations: 918",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1153,15 +1153,19 @@
"_": "->------------------------] Subtitles [------------------------<-",
"create.subtitle.schematicannon_launch_block": "Bauplankanone schießt",
"create.subtitle.schematicannon_finish": "Bauplankanone endet",
"create.subtitle.cogs": "UNLOCALIZED: Cogwheels rumble",
"create.subtitle.slime_added": "Schleim matscht",
"create.subtitle.mechanical_press_activation_belt": "UNLOCALIZED: Mechanical Press bonks",
"create.subtitle.mechanical_press_activation": "Mechanische Presse wird aktiviert",
"create.subtitle.blockzapper_deny": "Ablehnendes Boop",
"create.subtitle.blockzapper_confirm": "Bestätigendes Ding",
"create.subtitle.depot_slide": "UNLOCALIZED: Item slides",
"create.subtitle.blockzapper_place": "Blöcke zappen an Ort und Stelle",
"create.subtitle.blaze_munch": "Lohe kaut glücklich",
"create.subtitle.schematicannon_launch_block": "Bauplankanone schießt",
"create.subtitle.funnel_flap": "UNLOCALIZED: Funnel Flaps",
"create.subtitle.schematicannon_finish": "Bauplankanone endet",
"create.subtitle.mechanical_press_activation": "Mechanische Presse wird aktiviert",
"create.subtitle.blockzapper_deny": "Ablehnendes Boop",
"create.subtitle.depot_plop": "UNLOCALIZED: Item lands",
"_": "->------------------------] Item Descriptions [------------------------<-",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 607",
"_": "Missing Localizations: 611",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1153,15 +1153,19 @@
"_": "->------------------------] Subtitles [------------------------<-",
"create.subtitle.schematicannon_launch_block": "Disparos de Schematicannon",
"create.subtitle.schematicannon_finish": "Acabados de Schematicannon",
"create.subtitle.cogs": "UNLOCALIZED: Cogwheels rumble",
"create.subtitle.slime_added": "Slime aplastado",
"create.subtitle.mechanical_press_activation_belt": "UNLOCALIZED: Mechanical Press bonks",
"create.subtitle.mechanical_press_activation": "La Prensa Mecánica se activa",
"create.subtitle.blockzapper_deny": "Boop declinante",
"create.subtitle.blockzapper_confirm": "Ding afirmativo",
"create.subtitle.depot_slide": "UNLOCALIZED: Item slides",
"create.subtitle.blockzapper_place": "Los bloques se colocan en su sitio",
"create.subtitle.blaze_munch": "Blaze mastica felizmente",
"create.subtitle.schematicannon_launch_block": "Disparos de Schematicannon",
"create.subtitle.funnel_flap": "UNLOCALIZED: Funnel Flaps",
"create.subtitle.schematicannon_finish": "Acabados de Schematicannon",
"create.subtitle.mechanical_press_activation": "La Prensa Mecánica se activa",
"create.subtitle.blockzapper_deny": "Boop declinante",
"create.subtitle.depot_plop": "UNLOCALIZED: Item lands",
"_": "->------------------------] Item Descriptions [------------------------<-",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1265",
"_": "Missing Localizations: 1269",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1153,15 +1153,19 @@
"_": "->------------------------] Subtitles [------------------------<-",
"create.subtitle.schematicannon_launch_block": "UNLOCALIZED: Schematicannon fires",
"create.subtitle.schematicannon_finish": "UNLOCALIZED: Schematicannon dings",
"create.subtitle.cogs": "UNLOCALIZED: Cogwheels rumble",
"create.subtitle.slime_added": "UNLOCALIZED: Slime squishes",
"create.subtitle.mechanical_press_activation_belt": "UNLOCALIZED: Mechanical Press bonks",
"create.subtitle.mechanical_press_activation": "UNLOCALIZED: Mechanical Press clangs",
"create.subtitle.blockzapper_deny": "UNLOCALIZED: Declining boop",
"create.subtitle.blockzapper_confirm": "UNLOCALIZED: Affirmative ding",
"create.subtitle.depot_slide": "UNLOCALIZED: Item slides",
"create.subtitle.blockzapper_place": "UNLOCALIZED: Blockzapper zaps",
"create.subtitle.blaze_munch": "UNLOCALIZED: Blaze Burner munches",
"create.subtitle.schematicannon_launch_block": "UNLOCALIZED: Schematicannon fires",
"create.subtitle.funnel_flap": "UNLOCALIZED: Funnel Flaps",
"create.subtitle.schematicannon_finish": "UNLOCALIZED: Schematicannon dings",
"create.subtitle.mechanical_press_activation": "UNLOCALIZED: Mechanical Press clangs",
"create.subtitle.blockzapper_deny": "UNLOCALIZED: Declining boop",
"create.subtitle.depot_plop": "UNLOCALIZED: Item lands",
"_": "->------------------------] Item Descriptions [------------------------<-",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1164",
"_": "Missing Localizations: 1168",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1153,15 +1153,19 @@
"_": "->------------------------] Subtitles [------------------------<-",
"create.subtitle.schematicannon_launch_block": "Tir de schémacanon",
"create.subtitle.schematicannon_finish": "Fin de schémacanon",
"create.subtitle.cogs": "UNLOCALIZED: Cogwheels rumble",
"create.subtitle.slime_added": "Bruit de slime",
"create.subtitle.mechanical_press_activation_belt": "UNLOCALIZED: Mechanical Press bonks",
"create.subtitle.mechanical_press_activation": "Activation de la presse mechanique",
"create.subtitle.blockzapper_deny": "Boop de déclin",
"create.subtitle.blockzapper_confirm": "Ding d'affirmation",
"create.subtitle.depot_slide": "UNLOCALIZED: Item slides",
"create.subtitle.blockzapper_place": "Blocs se zappant en place",
"create.subtitle.blaze_munch": "UNLOCALIZED: Blaze Burner munches",
"create.subtitle.schematicannon_launch_block": "Tir de schémacanon",
"create.subtitle.funnel_flap": "UNLOCALIZED: Funnel Flaps",
"create.subtitle.schematicannon_finish": "Fin de schémacanon",
"create.subtitle.mechanical_press_activation": "Activation de la presse mechanique",
"create.subtitle.blockzapper_deny": "Boop de déclin",
"create.subtitle.depot_plop": "UNLOCALIZED: Item lands",
"_": "->------------------------] Item Descriptions [------------------------<-",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 624",
"_": "Missing Localizations: 628",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1153,15 +1153,19 @@
"_": "->------------------------] Subtitles [------------------------<-",
"create.subtitle.schematicannon_launch_block": "Tiri del cannoneschematico",
"create.subtitle.schematicannon_finish": "Finiture cannoneschematico",
"create.subtitle.cogs": "UNLOCALIZED: Cogwheels rumble",
"create.subtitle.slime_added": "Slime schiacciato",
"create.subtitle.mechanical_press_activation_belt": "UNLOCALIZED: Mechanical Press bonks",
"create.subtitle.mechanical_press_activation": "Pressa meccanica attiva",
"create.subtitle.blockzapper_deny": "Boop in calo",
"create.subtitle.blockzapper_confirm": "Ding affermativo",
"create.subtitle.depot_slide": "UNLOCALIZED: Item slides",
"create.subtitle.blockzapper_place": "Posiziona blocchi nello spazio",
"create.subtitle.blaze_munch": "Il blaze lo gusta felicemente",
"create.subtitle.schematicannon_launch_block": "Tiri del cannoneschematico",
"create.subtitle.funnel_flap": "UNLOCALIZED: Funnel Flaps",
"create.subtitle.schematicannon_finish": "Finiture cannoneschematico",
"create.subtitle.mechanical_press_activation": "Pressa meccanica attiva",
"create.subtitle.blockzapper_deny": "Boop in calo",
"create.subtitle.depot_plop": "UNLOCALIZED: Item lands",
"_": "->------------------------] Item Descriptions [------------------------<-",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 606",
"_": "Missing Localizations: 610",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1153,15 +1153,19 @@
"_": "->------------------------] Subtitles [------------------------<-",
"create.subtitle.schematicannon_launch_block": "概略図砲が発射する",
"create.subtitle.schematicannon_finish": "概略図砲が作業を終える",
"create.subtitle.cogs": "UNLOCALIZED: Cogwheels rumble",
"create.subtitle.slime_added": "スライムがぐしゃっとつぶれる",
"create.subtitle.mechanical_press_activation_belt": "UNLOCALIZED: Mechanical Press bonks",
"create.subtitle.mechanical_press_activation": "メカニカルプレスが作動する",
"create.subtitle.blockzapper_deny": "失敗音",
"create.subtitle.blockzapper_confirm": "成功音",
"create.subtitle.depot_slide": "UNLOCALIZED: Item slides",
"create.subtitle.blockzapper_place": "ブロックを発射して設置する",
"create.subtitle.blaze_munch": "ブレイズの咀嚼音",
"create.subtitle.schematicannon_launch_block": "概略図砲が発射する",
"create.subtitle.funnel_flap": "UNLOCALIZED: Funnel Flaps",
"create.subtitle.schematicannon_finish": "概略図砲が作業を終える",
"create.subtitle.mechanical_press_activation": "メカニカルプレスが作動する",
"create.subtitle.blockzapper_deny": "失敗音",
"create.subtitle.depot_plop": "UNLOCALIZED: Item lands",
"_": "->------------------------] Item Descriptions [------------------------<-",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 677",
"_": "Missing Localizations: 681",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1153,15 +1153,19 @@
"_": "->------------------------] Subtitles [------------------------<-",
"create.subtitle.schematicannon_launch_block": "청사진 대포가 발포함",
"create.subtitle.schematicannon_finish": "청사진 대포가 끝남",
"create.subtitle.cogs": "UNLOCALIZED: Cogwheels rumble",
"create.subtitle.slime_added": "슬라임이 철퍽거림",
"create.subtitle.mechanical_press_activation_belt": "UNLOCALIZED: Mechanical Press bonks",
"create.subtitle.mechanical_press_activation": "압착기가 가동됨",
"create.subtitle.blockzapper_deny": "취소 효과음",
"create.subtitle.blockzapper_confirm": "확인 효과음",
"create.subtitle.depot_slide": "UNLOCALIZED: Item slides",
"create.subtitle.blockzapper_place": "블록이 순간이동됨",
"create.subtitle.blaze_munch": "블레이즈가 행복하게 섭취함",
"create.subtitle.schematicannon_launch_block": "청사진 대포가 발포함",
"create.subtitle.funnel_flap": "UNLOCALIZED: Funnel Flaps",
"create.subtitle.schematicannon_finish": "청사진 대포가 끝남",
"create.subtitle.mechanical_press_activation": "압착기가 가동됨",
"create.subtitle.blockzapper_deny": "취소 효과음",
"create.subtitle.depot_plop": "UNLOCALIZED: Item lands",
"_": "->------------------------] Item Descriptions [------------------------<-",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1554",
"_": "Missing Localizations: 1558",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1153,15 +1153,19 @@
"_": "->------------------------] Subtitles [------------------------<-",
"create.subtitle.schematicannon_launch_block": "UNLOCALIZED: Schematicannon fires",
"create.subtitle.schematicannon_finish": "UNLOCALIZED: Schematicannon dings",
"create.subtitle.cogs": "UNLOCALIZED: Cogwheels rumble",
"create.subtitle.slime_added": "UNLOCALIZED: Slime squishes",
"create.subtitle.mechanical_press_activation_belt": "UNLOCALIZED: Mechanical Press bonks",
"create.subtitle.mechanical_press_activation": "UNLOCALIZED: Mechanical Press clangs",
"create.subtitle.blockzapper_deny": "UNLOCALIZED: Declining boop",
"create.subtitle.blockzapper_confirm": "UNLOCALIZED: Affirmative ding",
"create.subtitle.depot_slide": "UNLOCALIZED: Item slides",
"create.subtitle.blockzapper_place": "UNLOCALIZED: Blockzapper zaps",
"create.subtitle.blaze_munch": "UNLOCALIZED: Blaze Burner munches",
"create.subtitle.schematicannon_launch_block": "UNLOCALIZED: Schematicannon fires",
"create.subtitle.funnel_flap": "UNLOCALIZED: Funnel Flaps",
"create.subtitle.schematicannon_finish": "UNLOCALIZED: Schematicannon dings",
"create.subtitle.mechanical_press_activation": "UNLOCALIZED: Mechanical Press clangs",
"create.subtitle.blockzapper_deny": "UNLOCALIZED: Declining boop",
"create.subtitle.depot_plop": "UNLOCALIZED: Item lands",
"_": "->------------------------] Item Descriptions [------------------------<-",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1608",
"_": "Missing Localizations: 1612",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1153,15 +1153,19 @@
"_": "->------------------------] Subtitles [------------------------<-",
"create.subtitle.schematicannon_launch_block": "UNLOCALIZED: Schematicannon fires",
"create.subtitle.schematicannon_finish": "UNLOCALIZED: Schematicannon dings",
"create.subtitle.cogs": "UNLOCALIZED: Cogwheels rumble",
"create.subtitle.slime_added": "UNLOCALIZED: Slime squishes",
"create.subtitle.mechanical_press_activation_belt": "UNLOCALIZED: Mechanical Press bonks",
"create.subtitle.mechanical_press_activation": "UNLOCALIZED: Mechanical Press clangs",
"create.subtitle.blockzapper_deny": "UNLOCALIZED: Declining boop",
"create.subtitle.blockzapper_confirm": "UNLOCALIZED: Affirmative ding",
"create.subtitle.depot_slide": "UNLOCALIZED: Item slides",
"create.subtitle.blockzapper_place": "UNLOCALIZED: Blockzapper zaps",
"create.subtitle.blaze_munch": "UNLOCALIZED: Blaze Burner munches",
"create.subtitle.schematicannon_launch_block": "UNLOCALIZED: Schematicannon fires",
"create.subtitle.funnel_flap": "UNLOCALIZED: Funnel Flaps",
"create.subtitle.schematicannon_finish": "UNLOCALIZED: Schematicannon dings",
"create.subtitle.mechanical_press_activation": "UNLOCALIZED: Mechanical Press clangs",
"create.subtitle.blockzapper_deny": "UNLOCALIZED: Declining boop",
"create.subtitle.depot_plop": "UNLOCALIZED: Item lands",
"_": "->------------------------] Item Descriptions [------------------------<-",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 521",
"_": "Missing Localizations: 525",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1153,15 +1153,19 @@
"_": "->------------------------] Subtitles [------------------------<-",
"create.subtitle.schematicannon_launch_block": "Выстрелы схематичной пушки",
"create.subtitle.schematicannon_finish": "Схематичная пушка закончила работу",
"create.subtitle.cogs": "UNLOCALIZED: Cogwheels rumble",
"create.subtitle.slime_added": "Намазывание слизи",
"create.subtitle.mechanical_press_activation_belt": "UNLOCALIZED: Mechanical Press bonks",
"create.subtitle.mechanical_press_activation": "Механический пресс активирован",
"create.subtitle.blockzapper_deny": "Тихий буп",
"create.subtitle.blockzapper_confirm": "Утвердительный динь",
"create.subtitle.depot_slide": "UNLOCALIZED: Item slides",
"create.subtitle.blockzapper_place": "Блок запрыгивает на место",
"create.subtitle.blaze_munch": "Всполох радостно жуёт",
"create.subtitle.schematicannon_launch_block": "Выстрелы схематичной пушки",
"create.subtitle.funnel_flap": "UNLOCALIZED: Funnel Flaps",
"create.subtitle.schematicannon_finish": "Схематичная пушка закончила работу",
"create.subtitle.mechanical_press_activation": "Механический пресс активирован",
"create.subtitle.blockzapper_deny": "Тихий буп",
"create.subtitle.depot_plop": "UNLOCALIZED: Item lands",
"_": "->------------------------] Item Descriptions [------------------------<-",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 621",
"_": "Missing Localizations: 625",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1153,15 +1153,19 @@
"_": "->------------------------] Subtitles [------------------------<-",
"create.subtitle.schematicannon_launch_block": "蓝图加农炮:发射",
"create.subtitle.schematicannon_finish": "蓝图加农炮:完成任务",
"create.subtitle.cogs": "UNLOCALIZED: Cogwheels rumble",
"create.subtitle.slime_added": "粘液:挤碎声",
"create.subtitle.mechanical_press_activation_belt": "UNLOCALIZED: Mechanical Press bonks",
"create.subtitle.mechanical_press_activation": "辊压机:工作中",
"create.subtitle.blockzapper_deny": "放置失败",
"create.subtitle.blockzapper_confirm": "选择方块",
"create.subtitle.depot_slide": "UNLOCALIZED: Item slides",
"create.subtitle.blockzapper_place": "放置方块",
"create.subtitle.blaze_munch": "烈焰人:开心地咀嚼着",
"create.subtitle.schematicannon_launch_block": "蓝图加农炮:发射",
"create.subtitle.funnel_flap": "UNLOCALIZED: Funnel Flaps",
"create.subtitle.schematicannon_finish": "蓝图加农炮:完成任务",
"create.subtitle.mechanical_press_activation": "辊压机:工作中",
"create.subtitle.blockzapper_deny": "放置失败",
"create.subtitle.depot_plop": "UNLOCALIZED: Item lands",
"_": "->------------------------] Item Descriptions [------------------------<-",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 626",
"_": "Missing Localizations: 630",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1153,15 +1153,19 @@
"_": "->------------------------] Subtitles [------------------------<-",
"create.subtitle.schematicannon_launch_block": "藍圖大炮發射",
"create.subtitle.schematicannon_finish": "藍圖大炮完成任務",
"create.subtitle.cogs": "UNLOCALIZED: Cogwheels rumble",
"create.subtitle.slime_added": "黏液擠壓",
"create.subtitle.mechanical_press_activation_belt": "UNLOCALIZED: Mechanical Press bonks",
"create.subtitle.mechanical_press_activation": "液壓機工作",
"create.subtitle.blockzapper_deny": "放置失敗",
"create.subtitle.blockzapper_confirm": "選擇方塊",
"create.subtitle.depot_slide": "UNLOCALIZED: Item slides",
"create.subtitle.blockzapper_place": "放置方塊",
"create.subtitle.blaze_munch": "烈焰使者開心地吃著",
"create.subtitle.schematicannon_launch_block": "藍圖大炮發射",
"create.subtitle.funnel_flap": "UNLOCALIZED: Funnel Flaps",
"create.subtitle.schematicannon_finish": "藍圖大炮完成任務",
"create.subtitle.mechanical_press_activation": "液壓機工作",
"create.subtitle.blockzapper_deny": "放置失敗",
"create.subtitle.depot_plop": "UNLOCALIZED: Item lands",
"_": "->------------------------] Item Descriptions [------------------------<-",

View file

@ -35,6 +35,47 @@
],
"subtitle": "create.subtitle.blockzapper_place"
},
"cogs": {
"sounds": [
"create:cogs"
],
"subtitle": "create.subtitle.cogs"
},
"depot_plop": {
"sounds": [
{
"name": "minecraft:entity.item_frame.add_item",
"type": "event"
}
],
"subtitle": "create.subtitle.depot_plop"
},
"depot_slide": {
"sounds": [
{
"name": "minecraft:block.sand.break",
"type": "event"
}
],
"subtitle": "create.subtitle.depot_slide"
},
"funnel_flap": {
"sounds": [
{
"name": "minecraft:entity.item_frame.rotate_item",
"type": "event"
}
],
"subtitle": "create.subtitle.funnel_flap"
},
"funnel_flap_compounded_1": {
"sounds": [
{
"name": "minecraft:block.wool.place",
"type": "event"
}
]
},
"mechanical_press_activation": {
"sounds": [
{

View file

@ -447,6 +447,7 @@ public class AllBlocks {
public static final BlockEntry<BasinBlock> BASIN = REGISTRATE.block("basin", BasinBlock::new)
.initialProperties(SharedProperties::stone)
.properties(p -> p.sound(SoundType.NETHERITE))
.blockstate(new BasinGenerator()::generate)
.onRegister(addMovementBehaviour(new BasinMovementBehaviour()))
.item()
@ -496,6 +497,7 @@ public class AllBlocks {
public static final BlockEntry<ChuteBlock> CHUTE = REGISTRATE.block("chute", ChuteBlock::new)
.initialProperties(SharedProperties::softMetal)
.properties(p -> p.sound(SoundType.NETHERITE))
.addLayer(() -> RenderType::getCutoutMipped)
.blockstate(new ChuteGenerator()::generate)
.item(ChuteItem::new)
@ -504,6 +506,7 @@ public class AllBlocks {
public static final BlockEntry<SmartChuteBlock> SMART_CHUTE = REGISTRATE.block("smart_chute", SmartChuteBlock::new)
.initialProperties(SharedProperties::softMetal)
.properties(p -> p.sound(SoundType.NETHERITE))
.blockstate((c, p) -> BlockStateGen.simpleBlock(c, p, AssetLookup.forPowered(c, p)))
.item()
.transform(customItemModel("_", "block"))

View file

@ -45,6 +45,22 @@ public class AllSoundEvents {
.category(SoundCategory.BLOCKS)
.build(),
DEPOT_SLIDE = create("depot_slide").subtitle("Item slides")
.playExisting(SoundEvents.BLOCK_SAND_BREAK, .125f, 1.5f)
.category(SoundCategory.BLOCKS)
.build(),
DEPOT_PLOP = create("depot_plop").subtitle("Item lands")
.playExisting(SoundEvents.ENTITY_ITEM_FRAME_ADD_ITEM, .25f, 1.25f)
.category(SoundCategory.BLOCKS)
.build(),
FUNNEL_FLAP = create("funnel_flap").subtitle("Funnel Flaps")
.playExisting(SoundEvents.ENTITY_ITEM_FRAME_ROTATE_ITEM, .125f, 1.5f)
.playExisting(SoundEvents.BLOCK_WOOL_BREAK, .0425f, .75f)
.category(SoundCategory.BLOCKS)
.build(),
SLIME_ADDED = create("slime_added").subtitle("Slime squishes")
.playExisting(SoundEvents.BLOCK_SLIME_BLOCK_PLACE)
.category(SoundCategory.BLOCKS)
@ -78,6 +94,10 @@ public class AllSoundEvents {
.category(SoundCategory.PLAYERS)
.build(),
COGS = create("cogs").subtitle("Cogwheels rumble")
.category(SoundCategory.BLOCKS)
.build(),
BLAZE_MUNCH = create("blaze_munch").subtitle("Blaze Burner munches")
.playExisting(SoundEvents.ENTITY_GENERIC_EAT, .5f, 1f)
.category(SoundCategory.BLOCKS)
@ -212,6 +232,8 @@ public class AllSoundEvents {
public abstract void write(JsonObject json);
public abstract SoundEvent getMainEvent();
public String getSubtitleKey() {
return Create.ID + ".subtitle." + id;
}
@ -255,6 +277,12 @@ public class AllSoundEvents {
abstract void play(World world, PlayerEntity entity, double x, double y, double z, float volume, float pitch);
public void playAt(World world, BlockPos pos, float volume, float pitch, boolean fade) {
playAt(world, pos.getX(), pos.getY(), pos.getZ(), volume, pitch, fade);
}
public abstract void playAt(World world, double x, double y, double z, float volume, float pitch, boolean fade);
}
static class WrappedSoundEntry extends SoundEntry {
@ -280,6 +308,12 @@ public class AllSoundEvents {
}
}
@Override
public SoundEvent getMainEvent() {
return compiledEvents.get(0)
.getFirst();
}
protected String getIdOf(int i) {
return i == 0 ? id : id + "_compounded_" + i;
}
@ -311,6 +345,15 @@ public class AllSoundEvents {
volPitch.getSecond() * pitch);
}
}
@Override
public void playAt(World world, double x, double y, double z, float volume, float pitch, boolean fade) {
for (Pair<SoundEvent, Couple<Float>> pair : compiledEvents) {
Couple<Float> volPitch = pair.getSecond();
world.playSound(x, y, z, pair.getFirst(), category, volPitch.getFirst() * volume,
volPitch.getSecond() * pitch, fade);
}
}
}
static class CustomSoundEntry extends SoundEntry {
@ -324,8 +367,12 @@ public class AllSoundEvents {
@Override
public void register(IForgeRegistry<SoundEvent> registry) {
ResourceLocation location = getLocation();
SoundEvent sound = new SoundEvent(location).setRegistryName(location);
registry.register(sound);
registry.register(event = new SoundEvent(location).setRegistryName(location));
}
@Override
public SoundEvent getMainEvent() {
return event;
}
@Override
@ -343,6 +390,11 @@ public class AllSoundEvents {
world.playSound(entity, x, y, z, event, category, volume, pitch);
}
@Override
public void playAt(World world, double x, double y, double z, float volume, float pitch, boolean fade) {
world.playSound(x, y, z, event, category, volume, pitch, fade);
}
}
}

View file

@ -15,10 +15,12 @@ import com.simibubi.create.content.contraptions.base.IRotate.StressImpact;
import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation;
import com.simibubi.create.content.contraptions.goggles.IHaveHoveringInformation;
import com.simibubi.create.content.contraptions.relays.elementary.ICogWheel;
import com.simibubi.create.content.contraptions.relays.gearbox.GearboxBlock;
import com.simibubi.create.foundation.config.AllConfigs;
import com.simibubi.create.foundation.item.TooltipHelper;
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
import com.simibubi.create.foundation.render.backend.instancing.IInstanceRendered;
import com.simibubi.create.foundation.sound.SoundScapes;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.utility.Lang;
@ -36,12 +38,14 @@ import net.minecraft.util.Direction.Axis;
import net.minecraft.util.Direction.AxisDirection;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.DistExecutor;
public abstract class KineticTileEntity extends SmartTileEntity
implements ITickableTileEntity, IHaveGoggleInformation, IHaveHoveringInformation, IInstanceRendered {
@ -93,6 +97,7 @@ public abstract class KineticTileEntity extends SmartTileEntity
if (world.isRemote) {
cachedBoundingBox = null; // cache the bounding box for every frame between ticks
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> this.tickAudio());
return;
}
@ -391,21 +396,28 @@ public abstract class KineticTileEntity extends SmartTileEntity
boolean notFastEnough = !isSpeedRequirementFulfilled() && getSpeed() != 0;
if (overStressed && AllConfigs.CLIENT.enableOverstressedTooltip.get()) {
tooltip.add(componentSpacing.copy().append(Lang.translate("gui.stressometer.overstressed").formatted(GOLD)));
tooltip.add(componentSpacing.copy()
.append(Lang.translate("gui.stressometer.overstressed")
.formatted(GOLD)));
ITextComponent hint = Lang.translate("gui.contraptions.network_overstressed");
List<ITextComponent> cutString = TooltipHelper.cutTextComponent(hint, GRAY, TextFormatting.WHITE);
for (int i = 0; i < cutString.size(); i++)
tooltip.add(componentSpacing.copy().append(cutString.get(i)));
tooltip.add(componentSpacing.copy()
.append(cutString.get(i)));
return true;
}
if (notFastEnough) {
tooltip.add(componentSpacing.copy().append(Lang.translate("tooltip.speedRequirement").formatted(GOLD)));
ITextComponent hint = Lang.translate("gui.contraptions.not_fast_enough", I18n.format(getBlockState().getBlock()
.getTranslationKey()));
tooltip.add(componentSpacing.copy()
.append(Lang.translate("tooltip.speedRequirement")
.formatted(GOLD)));
ITextComponent hint =
Lang.translate("gui.contraptions.not_fast_enough", I18n.format(getBlockState().getBlock()
.getTranslationKey()));
List<ITextComponent> cutString = TooltipHelper.cutTextComponent(hint, GRAY, TextFormatting.WHITE);
for (int i = 0; i < cutString.size(); i++)
tooltip.add(componentSpacing.copy().append(cutString.get(i)));
tooltip.add(componentSpacing.copy()
.append(cutString.get(i)));
return true;
}
@ -418,13 +430,21 @@ public abstract class KineticTileEntity extends SmartTileEntity
float stressAtBase = calculateStressApplied();
if (calculateStressApplied() != 0 && StressImpact.isEnabled()) {
tooltip.add(componentSpacing.copy().append(Lang.translate("gui.goggles.kinetic_stats")));
tooltip.add(componentSpacing.copy().append(Lang.translate("tooltip.stressImpact").formatted(TextFormatting.GRAY)));
tooltip.add(componentSpacing.copy()
.append(Lang.translate("gui.goggles.kinetic_stats")));
tooltip.add(componentSpacing.copy()
.append(Lang.translate("tooltip.stressImpact")
.formatted(TextFormatting.GRAY)));
float stressTotal = stressAtBase * Math.abs(getTheoreticalSpeed());
tooltip.add(componentSpacing.copy().append(new StringTextComponent(" " + IHaveGoggleInformation.format(stressTotal))
.append(Lang.translate("generic.unit.stress")).append(" ").formatted(TextFormatting.AQUA)).append(Lang.translate("gui.goggles.at_current_speed").formatted(TextFormatting.DARK_GRAY)));
tooltip.add(componentSpacing.copy()
.append(new StringTextComponent(" " + IHaveGoggleInformation.format(stressTotal))
.append(Lang.translate("generic.unit.stress"))
.append(" ")
.formatted(TextFormatting.AQUA))
.append(Lang.translate("gui.goggles.at_current_speed")
.formatted(TextFormatting.DARK_GRAY)));
added = true;
}
@ -537,6 +557,7 @@ public abstract class KineticTileEntity extends SmartTileEntity
}
protected AxisAlignedBB cachedBoundingBox;
@OnlyIn(Dist.CLIENT)
public AxisAlignedBB getRenderBoundingBox() {
if (cachedBoundingBox == null) {
@ -548,4 +569,24 @@ public abstract class KineticTileEntity extends SmartTileEntity
protected AxisAlignedBB makeRenderBoundingBox() {
return super.getRenderBoundingBox();
}
@OnlyIn(Dist.CLIENT)
public void tickAudio() {
float componentSpeed = Math.abs(getSpeed());
if (componentSpeed == 0)
return;
float pitch = MathHelper.clamp((componentSpeed / 256f) + .45f, .5f, 1.25f);
if (isNoisy())
SoundScapes.playGeneralKineticAmbience(pos, pitch);
Block block = getBlockState().getBlock();
if (ICogWheel.isSmallCog(block) || ICogWheel.isSmallCog(block) || block instanceof GearboxBlock)
SoundScapes.playCogwheelAmbience(pos, pitch);
}
protected boolean isNoisy() {
return true;
}
}

View file

@ -19,6 +19,7 @@ import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.item.ItemEntity;
@ -39,6 +40,9 @@ import net.minecraft.util.math.shapes.VoxelShapes;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.vector.Vector3i;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.DistExecutor;
public class AirCurrent {
@ -58,6 +62,8 @@ public class AirCurrent {
new ArrayList<>();
protected List<Entity> caughtEntities = new ArrayList<>();
static boolean isClientPlayerInAirCurrent;
public AirCurrent(IAirCurrentSource source) {
this.source = source;
}
@ -70,7 +76,8 @@ public class AirCurrent {
if (world != null && world.isRemote) {
float offset = pushing ? 0.5f : maxDistance + .5f;
Vector3d pos = VecHelper.getCenterOf(source.getAirCurrentPos())
.add(Vector3d.of(facing.getDirectionVec()).scale(offset));
.add(Vector3d.of(facing.getDirectionVec())
.scale(offset));
if (world.rand.nextFloat() < AllConfigs.CLIENT.fanParticleDensity.get())
world.addParticle(new AirFlowParticleData(source.getAirCurrentPos()), pos.x, pos.y, pos.z, 0, 0, 0);
}
@ -108,6 +115,8 @@ public class AirCurrent {
entity.setMotion(previousMotion.add(new Vector3d(xIn, yIn, zIn).scale(1 / 8f)));
entity.fallDistance = 0;
DistExecutor.unsafeRunWhenOn(Dist.CLIENT,
() -> () -> enableClientPlayerSound(entity, MathHelper.clamp(speed / 128f * .4f, 0.01f, .4f)));
if (entity instanceof ServerPlayerEntity)
((ServerPlayerEntity) entity).connection.floatingTickCount = 0;
@ -115,7 +124,8 @@ public class AirCurrent {
entityDistance -= .5f;
InWorldProcessing.Type processingType = getSegmentAt((float) entityDistance);
if (entity instanceof ServerPlayerEntity)
AllTriggers.triggerFor(AllTriggers.FAN_PROCESSING.constructTriggerFor(processingType), (PlayerEntity) entity);
AllTriggers.triggerFor(AllTriggers.FAN_PROCESSING.constructTriggerFor(processingType),
(PlayerEntity) entity);
if (processingType == null || processingType == Type.NONE) {
continue;
@ -343,7 +353,40 @@ public class AirCurrent {
InWorldProcessing.Type type;
int startOffset;
int endOffset;
}
@OnlyIn(Dist.CLIENT)
static AirCurrentSound flyingSound = null;
@OnlyIn(Dist.CLIENT)
private static void enableClientPlayerSound(Entity e, float maxVolume) {
if (e != Minecraft.getInstance()
.getRenderViewEntity())
return;
isClientPlayerInAirCurrent = true;
float pitch = (float) MathHelper.clamp(e.getMotion()
.length() * .5f, .5f, 2f);
if (flyingSound == null || flyingSound.isDonePlaying()) {
flyingSound = new AirCurrentSound(SoundEvents.ITEM_ELYTRA_FLYING, pitch);
Minecraft.getInstance()
.getSoundHandler()
.play(flyingSound);
}
flyingSound.setPitch(pitch);
flyingSound.fadeIn(maxVolume);
}
@OnlyIn(Dist.CLIENT)
public static void tickClientPlayerSounds() {
if (!AirCurrent.isClientPlayerInAirCurrent && flyingSound != null)
if (flyingSound.isFaded())
flyingSound.stop();
else
flyingSound.fadeOut();
isClientPlayerInAirCurrent = false;
}
}

View file

@ -0,0 +1,48 @@
package com.simibubi.create.content.contraptions.components.fan;
import net.minecraft.client.audio.TickableSound;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvent;
public class AirCurrentSound extends TickableSound {
private float pitch;
protected AirCurrentSound(SoundEvent p_i46532_1_, float pitch) {
super(p_i46532_1_, SoundCategory.BLOCKS);
this.pitch = pitch;
volume = 0.01f;
repeat = true;
repeatDelay = 0;
global = true;
}
@Override
public void tick() {}
public void setPitch(float pitch) {
this.pitch = pitch;
}
public void fadeIn(float maxVolume) {
volume = Math.min(maxVolume, volume + .05f);
}
public void fadeOut() {
volume = Math.max(0, volume - .05f);
}
public boolean isFaded() {
return volume == 0;
}
@Override
public float getPitch() {
return pitch;
}
public void stop() {
setDone();
}
}

View file

@ -99,5 +99,10 @@ public class GantryShaftTileEntity extends KineticTileEntity {
return 0;
return MathHelper.clamp(-getSpeed() / 512f, -.49f, .49f);
}
@Override
protected boolean isNoisy() {
return false;
}
}

View file

@ -20,9 +20,8 @@ public class SimpleKineticTileEntity extends KineticTileEntity {
@Override
public void addBehaviours(List<TileEntityBehaviour> behaviours) {
behaviours.add(
new BracketedTileEntityBehaviour(this, state -> state.getBlock() instanceof AbstractShaftBlock).withTrigger(
state -> AllTriggers.BRACKET_APPLY_TRIGGER.constructTriggerFor(state.getBlock())));
behaviours.add(new BracketedTileEntityBehaviour(this, state -> state.getBlock() instanceof AbstractShaftBlock)
.withTrigger(state -> AllTriggers.BRACKET_APPLY_TRIGGER.constructTriggerFor(state.getBlock())));
super.addBehaviours(behaviours);
}
@ -44,4 +43,9 @@ public class SimpleKineticTileEntity extends KineticTileEntity {
return neighbours;
}
@Override
protected boolean isNoisy() {
return false;
}
}

View file

@ -10,4 +10,9 @@ public class GearboxTileEntity extends DirectionalShaftHalvesTileEntity {
super(type);
}
@Override
protected boolean isNoisy() {
return false;
}
}

View file

@ -7,6 +7,7 @@ import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
import com.simibubi.create.AllSoundEvents;
import com.simibubi.create.content.contraptions.relays.belt.BeltHelper;
import com.simibubi.create.content.contraptions.relays.belt.transport.TransportedItemStack;
import com.simibubi.create.content.logistics.block.funnel.AbstractFunnelBlock;
@ -274,8 +275,16 @@ public class DepotBehaviour extends TileEntityBehaviour {
return returned;
}
if (!simulate)
if (!simulate) {
if (this.isEmpty()) {
if (heldItem.insertedFrom.getAxis()
.isHorizontal())
AllSoundEvents.DEPOT_SLIDE.playOnServer(getWorld(), getPos());
else
AllSoundEvents.DEPOT_PLOP.playOnServer(getWorld(), getPos());
}
this.heldItem = heldItem;
}
return ItemStack.EMPTY;
}

View file

@ -1,6 +1,7 @@
package com.simibubi.create.content.logistics.block.depot;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllSoundEvents;
import com.simibubi.create.content.contraptions.relays.belt.transport.TransportedItemStack;
import com.simibubi.create.foundation.item.ItemHelper;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
@ -60,6 +61,7 @@ public class SharedDepotBlockMethods {
transported.beltPosition = .25f;
behaviour.setHeldItem(transported);
player.setHeldItem(hand, ItemStack.EMPTY);
AllSoundEvents.DEPOT_SLIDE.playOnServer(world, pos);
}
behaviour.tileEntity.notifyUpdate();

View file

@ -4,6 +4,7 @@ import java.lang.ref.WeakReference;
import java.util.List;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllSoundEvents;
import com.simibubi.create.content.contraptions.goggles.IHaveHoveringInformation;
import com.simibubi.create.content.contraptions.relays.belt.BeltHelper;
import com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity;
@ -61,7 +62,8 @@ public class FunnelTileEntity extends SmartTileEntity implements IHaveHoveringIn
BlockState state = getBlockState();
if (!FunnelBlock.isFunnel(state))
return Mode.INVALID;
if (state.method_28500(BlockStateProperties.POWERED).orElse(false))
if (state.method_28500(BlockStateProperties.POWERED)
.orElse(false))
return Mode.PAUSED;
if (state.getBlock() instanceof BeltFunnelBlock) {
Shape shape = state.get(BeltFunnelBlock.SHAPE);
@ -156,7 +158,8 @@ public class FunnelTileEntity extends SmartTileEntity implements IHaveHoveringIn
.isVertical();
boolean up = facing == Direction.UP;
outputPos = outputPos.add(Vector3d.of(facing.getDirectionVec()).scale(vertical ? up ? .15f : .5f : .25f));
outputPos = outputPos.add(Vector3d.of(facing.getDirectionVec())
.scale(vertical ? up ? .15f : .5f : .25f));
if (!vertical)
outputPos = outputPos.subtract(0, .45f, 0);
@ -283,6 +286,7 @@ public class FunnelTileEntity extends SmartTileEntity implements IHaveHoveringIn
AllPackets.channel.send(packetTarget(), new FunnelFlapPacket(this, inward));
} else {
flap.set(inward ? 1 : -1);
AllSoundEvents.FUNNEL_FLAP.playAt(world, pos, 1, 1, true);
}
}

View file

@ -10,6 +10,7 @@ import com.simibubi.create.Create;
import com.simibubi.create.CreateClient;
import com.simibubi.create.content.contraptions.KineticDebugger;
import com.simibubi.create.content.contraptions.base.IRotate;
import com.simibubi.create.content.contraptions.components.fan.AirCurrent;
import com.simibubi.create.content.contraptions.components.flywheel.engine.EngineBlock;
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionHandler;
import com.simibubi.create.content.contraptions.components.structureMovement.chassis.ChassisRangeDisplay;
@ -38,6 +39,7 @@ import com.simibubi.create.foundation.render.KineticRenderer;
import com.simibubi.create.foundation.render.backend.FastRenderDispatcher;
import com.simibubi.create.foundation.render.backend.RenderWork;
import com.simibubi.create.foundation.renderState.SuperRenderTypeBuffer;
import com.simibubi.create.foundation.sound.SoundScapes;
import com.simibubi.create.foundation.tileEntity.behaviour.edgeInteraction.EdgeInteractionRenderer;
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringRenderer;
import com.simibubi.create.foundation.tileEntity.behaviour.linked.LinkRenderer;
@ -87,12 +89,15 @@ public class ClientEvents {
@SubscribeEvent
public static void onTick(ClientTickEvent event) {
World world = Minecraft.getInstance().world;
if (event.phase == Phase.START)
return;
if (!isGameActive())
return;
if (event.phase == Phase.START) {
AirCurrent.tickClientPlayerSounds();
return;
}
SoundScapes.tick();
AnimationTickHolder.tick();
FastRenderDispatcher.tick();
ScrollValueHandler.tick();

View file

@ -0,0 +1,55 @@
package com.simibubi.create.foundation.sound;
import net.minecraft.client.audio.TickableSound;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvent;
public class ContinuousSound extends TickableSound {
private float sharedPitch;
private SoundScape scape;
private float relativeVolume;
protected ContinuousSound(SoundEvent event, SoundScape scape, float sharedPitch, float relativeVolume) {
super(event, SoundCategory.AMBIENT);
this.scape = scape;
this.sharedPitch = sharedPitch;
this.relativeVolume = relativeVolume;
this.repeat = true;
this.repeatDelay = 0;
this.global = false;
}
public void remove() {
setDone();
}
@Override
public float getVolume() {
return scape.getVolume() * relativeVolume;
}
@Override
public float getPitch() {
return sharedPitch;
}
@Override
public double getX() {
return scape.getMeanPos().x;
}
@Override
public double getY() {
return scape.getMeanPos().y;
}
@Override
public double getZ() {
return scape.getMeanPos().z;
}
@Override
public void tick() {}
}

View file

@ -0,0 +1,39 @@
package com.simibubi.create.foundation.sound;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import net.minecraft.client.Minecraft;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.vector.Vector3d;
public class RepeatingSound {
private SoundEvent event;
private float sharedPitch;
private int repeatDelay;
private SoundScape scape;
private float relativeVolume;
public RepeatingSound(SoundEvent event, SoundScape scape, float sharedPitch, float relativeVolume,
int repeatDelay) {
this.event = event;
this.scape = scape;
this.sharedPitch = sharedPitch;
this.relativeVolume = relativeVolume;
this.repeatDelay = Math.max(1, repeatDelay);
}
public void tick() {
if (AnimationTickHolder.getTicks() % repeatDelay != 0)
return;
ClientWorld world = Minecraft.getInstance().world;
Vector3d meanPos = scape.getMeanPos();
world.playSound(meanPos.x, meanPos.y, meanPos.z, event, SoundCategory.AMBIENT,
scape.getVolume() * relativeVolume, sharedPitch, true);
}
}

View file

@ -0,0 +1,88 @@
package com.simibubi.create.foundation.sound;
import java.util.ArrayList;
import java.util.List;
import com.simibubi.create.foundation.sound.SoundScapes.AmbienceGroup;
import com.simibubi.create.foundation.sound.SoundScapes.PitchGroup;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.client.Minecraft;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector3d;
class SoundScape {
List<ContinuousSound> continuous;
List<RepeatingSound> repeating;
private float pitch;
private AmbienceGroup group;
private Vector3d meanPos;
private PitchGroup pitchGroup;
public SoundScape(float pitch, AmbienceGroup group) {
this.pitchGroup = SoundScapes.getGroupFromPitch(pitch);
this.pitch = pitch;
this.group = group;
continuous = new ArrayList<>();
repeating = new ArrayList<>();
}
public SoundScape continuous(SoundEvent sound, float relativeVolume, float relativePitch) {
return add(new ContinuousSound(sound, this, pitch * relativePitch, relativeVolume));
}
public SoundScape repeating(SoundEvent sound, float relativeVolume, float relativePitch, int delay) {
return add(new RepeatingSound(sound, this, pitch * relativePitch, relativeVolume, delay));
}
public SoundScape add(ContinuousSound continuousSound) {
continuous.add(continuousSound);
return this;
}
public SoundScape add(RepeatingSound repeatingSound) {
repeating.add(repeatingSound);
return this;
}
public void play() {
continuous.forEach(Minecraft.getInstance()
.getSoundHandler()::play);
}
public void tick() {
if (AnimationTickHolder.getTicks() % SoundScapes.UPDATE_INTERVAL == 0)
meanPos = null;
repeating.forEach(RepeatingSound::tick);
}
public void remove() {
continuous.forEach(ContinuousSound::remove);
}
public Vector3d getMeanPos() {
return meanPos == null ? meanPos = determineMeanPos() : meanPos;
}
private Vector3d determineMeanPos() {
meanPos = Vector3d.ZERO;
int amount = 0;
for (BlockPos blockPos : SoundScapes.getAllLocations(group, pitchGroup)) {
meanPos = meanPos.add(VecHelper.getCenterOf(blockPos));
amount++;
}
if (amount == 0)
return meanPos;
return meanPos.scale(1f / amount);
}
public float getVolume() {
int soundCount = SoundScapes.getSoundCount(group, pitchGroup);
float argMax = (float) SoundScapes.SOUND_VOLUME_ARG_MAX;
return MathHelper.clamp(soundCount / (argMax * 10f), 0, .05f);
}
}

View file

@ -0,0 +1,150 @@
package com.simibubi.create.foundation.sound;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.function.BiFunction;
import com.simibubi.create.AllSoundEvents;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.Pair;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.BlockPos;
public class SoundScapes {
static final int MAX_AMBIENT_SOURCE_DISTANCE = 16;
static final int UPDATE_INTERVAL = 5;
static final int SOUND_VOLUME_ARG_MAX = 15;
enum AmbienceGroup {
KINETIC(SoundScapes::kinetic), COG(SoundScapes::cogwheel)
;
private BiFunction<Float, AmbienceGroup, SoundScape> factory;
private AmbienceGroup(BiFunction<Float, AmbienceGroup, SoundScape> factory) {
this.factory = factory;
}
public SoundScape instantiate(float pitch) {
return factory.apply(pitch, this);
}
}
private static SoundScape kinetic(float pitch, AmbienceGroup group) {
return new SoundScape(pitch, group).continuous(SoundEvents.ENTITY_MINECART_INSIDE, .25f, 1);
}
private static SoundScape cogwheel(float pitch, AmbienceGroup group) {
return new SoundScape(pitch, group).continuous(AllSoundEvents.COGS.getMainEvent(), 3, 1);
}
enum PitchGroup {
VERY_LOW, LOW, NORMAL, HIGH, VERY_HIGH
}
private static Map<AmbienceGroup, Map<PitchGroup, Set<BlockPos>>> counter = new IdentityHashMap<>();
private static Map<Pair<AmbienceGroup, PitchGroup>, SoundScape> activeSounds = new HashMap<>();
public static void playGeneralKineticAmbience(BlockPos pos, float pitch) {
if (!outOfRange(pos))
addSound(AmbienceGroup.KINETIC, pos, pitch);
}
public static void playCogwheelAmbience(BlockPos pos, float pitch) {
if (!outOfRange(pos))
addSound(AmbienceGroup.COG, pos, pitch);
}
public static void tick() {
activeSounds.values()
.forEach(SoundScape::tick);
if (AnimationTickHolder.getTicks() % UPDATE_INTERVAL != 0)
return;
for (Iterator<Entry<Pair<AmbienceGroup, PitchGroup>, SoundScape>> iterator = activeSounds.entrySet()
.iterator(); iterator.hasNext();) {
Entry<Pair<AmbienceGroup, PitchGroup>, SoundScape> entry = iterator.next();
Pair<AmbienceGroup, PitchGroup> key = entry.getKey();
SoundScape value = entry.getValue();
if (getSoundCount(key.getFirst(), key.getSecond()) == 0) {
value.remove();
iterator.remove();
}
}
counter.values()
.forEach(m -> m.values()
.forEach(Set::clear));
}
public static void addSound(AmbienceGroup group, BlockPos pos, float pitch) {
PitchGroup groupFromPitch = getGroupFromPitch(pitch);
Set<BlockPos> set = counter.computeIfAbsent(group, ag -> new IdentityHashMap<>())
.computeIfAbsent(groupFromPitch, pg -> new HashSet<>());
set.add(pos);
Pair<AmbienceGroup, PitchGroup> pair = Pair.of(group, groupFromPitch);
activeSounds.computeIfAbsent(pair, $ -> {
SoundScape soundScape = group.instantiate(pitch);
soundScape.play();
return soundScape;
});
}
public static void clean() {
BlockPos playerLocation = getCameraPos();
for (Map<PitchGroup, Set<BlockPos>> map : counter.values())
for (Set<BlockPos> set : map.values())
set.removeIf(p -> !playerLocation.withinDistance(p, MAX_AMBIENT_SOURCE_DISTANCE));
}
protected static boolean outOfRange(BlockPos pos) {
return !getCameraPos().withinDistance(pos, MAX_AMBIENT_SOURCE_DISTANCE);
}
protected static BlockPos getCameraPos() {
Entity renderViewEntity = Minecraft.getInstance().renderViewEntity;
if (renderViewEntity == null)
return BlockPos.ZERO;
BlockPos playerLocation = renderViewEntity.getBlockPos();
return playerLocation;
}
public static int getSoundCount(AmbienceGroup group, PitchGroup pitchGroup) {
return getAllLocations(group, pitchGroup).size();
}
public static Set<BlockPos> getAllLocations(AmbienceGroup group, PitchGroup pitchGroup) {
return counter.getOrDefault(group, Collections.emptyMap())
.getOrDefault(pitchGroup, Collections.emptySet());
}
public static PitchGroup getGroupFromPitch(float pitch) {
if (pitch < .70)
return PitchGroup.VERY_LOW;
if (pitch < .90)
return PitchGroup.LOW;
if (pitch < 1.10)
return PitchGroup.NORMAL;
if (pitch < 1.30)
return PitchGroup.HIGH;
return PitchGroup.VERY_HIGH;
}
}

Binary file not shown.