Choo Choo, Part III

- Steam whistles now play a seamless continuous sound
- Fixed an issue with the wrench and powered shafts
This commit is contained in:
simibubi 2022-05-08 19:49:23 +02:00
parent 56f4cd524d
commit d3c4613030
32 changed files with 187 additions and 56 deletions

View file

@ -544,22 +544,22 @@ bf2b0310500213ff853c748c236eb5d01f61658e assets/create/blockstates/yellow_toolbo
7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json
b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json
875f9aff979888b9d63d6a425cbf544431f1af5a assets/create/lang/en_ud.json
97c53a163e253dd1a8933a0ace74b9654d893587 assets/create/lang/en_us.json
12311e1c34d28139bbf8d7da53a116e066be6b9e assets/create/lang/unfinished/de_de.json
c63ceb535bf91819590021a3889dcd86cf529923 assets/create/lang/unfinished/es_cl.json
6862db283b26fbdcd901939e6c4b60641711a410 assets/create/lang/unfinished/es_es.json
1e66f6f48c7cebe998dcf9611cb41d3616444df6 assets/create/lang/unfinished/fr_fr.json
3fcccff2e2aa3029e260c5b521db927a99528658 assets/create/lang/unfinished/it_it.json
1b514b1cd75ea524b38ec1da48fdaa535827fcb4 assets/create/lang/unfinished/ja_jp.json
5b6f470baf2fef6252530fe88cc58530b948b44c assets/create/lang/unfinished/ko_kr.json
952e931c4d99d0c42c59ebc8f292d00cadd853dd assets/create/lang/unfinished/nl_nl.json
6c892826366d463b52a0cd2d2eeff00f6289346a assets/create/lang/unfinished/pl_pl.json
df275e393b8e8930d1863955d5563e49638d48c0 assets/create/lang/unfinished/pt_br.json
582a9e4d94df44f283103024781395791569dd4d assets/create/lang/unfinished/pt_pt.json
a114cdc8701e158bbb1ddbd90aa6b3a6615e1ca6 assets/create/lang/unfinished/ro_ro.json
4be727c1026bd66dce98518eb851de127eadab51 assets/create/lang/unfinished/ru_ru.json
e09205abffde3d10717284de6e405bb17c59b902 assets/create/lang/unfinished/zh_cn.json
e1f9d9ce9d4835fb69151af2908c3359c696d481 assets/create/lang/unfinished/zh_tw.json
1ad377f4a615552b93c377ca77d09d9c3cf72056 assets/create/lang/en_us.json
52303333ebdc11d4777bebc86200897dbb4a49a6 assets/create/lang/unfinished/de_de.json
c523a1dd9f0ea330f529359bb578de3df2bc1458 assets/create/lang/unfinished/es_cl.json
099f7b1f415189ece3f4601c5934d812ba27ec33 assets/create/lang/unfinished/es_es.json
77132328aec11c2d2489eebf7d7b5d6cbeea65c2 assets/create/lang/unfinished/fr_fr.json
400aedaa547301ac8f35aed1f0e804bba3439a4c assets/create/lang/unfinished/it_it.json
47e91eb3f234db0148251fc587dcf4dfcd03cf4d assets/create/lang/unfinished/ja_jp.json
d7b445abbf9189e0c2bb05a49948ec8515f43b76 assets/create/lang/unfinished/ko_kr.json
d870830f76c5e268f43af5b53187ac8efecd0a84 assets/create/lang/unfinished/nl_nl.json
6b3fcb59cec2b318a63dac081f677d90ae3774c6 assets/create/lang/unfinished/pl_pl.json
863971974b1d54b141c7b1d2a725ec1fd073edc6 assets/create/lang/unfinished/pt_br.json
1dec98db8807133fd2060957b35bf506bfad97ab assets/create/lang/unfinished/pt_pt.json
73d43d4434793a145f8a6cba865a3563b674f43b assets/create/lang/unfinished/ro_ro.json
a07148fa0254c4b9a4a47026f6da8c91f5a718ab assets/create/lang/unfinished/ru_ru.json
39e11d9262999468a4a5b61986aead6a9263c75d assets/create/lang/unfinished/zh_cn.json
754ad714ec33c27bb1b546fc12798d422beb865b 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
@ -2155,7 +2155,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
8b9dcd869179ac21a800b11693db6bb8cdd479a9 assets/create/sounds.json
79691595de849f2821595483c6486501581c66cd assets/create/sounds.json
0f1b4b980afba9bf2caf583b88e261bba8b10313 data/create/advancements/aesthetics.json
613e64b44bed959da899fdd54c1cacb227fb33f2 data/create/advancements/andesite_alloy.json
81885c6bfb85792c88aaa7c9b70f58832945d31f data/create/advancements/andesite_casing.json

View file

@ -1590,9 +1590,11 @@
"create.subtitle.wrench_rotate": "Wrench used",
"create.subtitle.potato_hit": "Vegetable impacts",
"create.subtitle.saw_activate_wood": "Mechanical Saw activates",
"create.subtitle.whistle_high": "Whistling",
"create.subtitle.haunted_bell_convert": "Haunted Bell awakens",
"create.subtitle.deny": "Declining boop",
"create.subtitle.controller_click": "Controller clicks",
"create.subtitle.whistle_low": "Whistling",
"create.subtitle.schematicannon_launch_block": "Schematicannon fires",
"create.subtitle.copper_armor_equip": "Diving equipment clinks",
"create.subtitle.controller_take": "Lectern empties",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1532",
"_": "Missing Localizations: 1534",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1591,9 +1591,11 @@
"create.subtitle.wrench_rotate": "UNLOCALIZED: Wrench used",
"create.subtitle.potato_hit": "UNLOCALIZED: Vegetable impacts",
"create.subtitle.saw_activate_wood": "UNLOCALIZED: Mechanical Saw activates",
"create.subtitle.whistle_high": "UNLOCALIZED: Whistling",
"create.subtitle.haunted_bell_convert": "UNLOCALIZED: Haunted Bell awakens",
"create.subtitle.deny": "UNLOCALIZED: Declining boop",
"create.subtitle.controller_click": "UNLOCALIZED: Controller clicks",
"create.subtitle.whistle_low": "UNLOCALIZED: Whistling",
"create.subtitle.schematicannon_launch_block": "Bauplankanone schießt",
"create.subtitle.copper_armor_equip": "UNLOCALIZED: Diving equipment clinks",
"create.subtitle.controller_take": "UNLOCALIZED: Lectern empties",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 554",
"_": "Missing Localizations: 556",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1591,9 +1591,11 @@
"create.subtitle.wrench_rotate": "Llave Inglesa usada",
"create.subtitle.potato_hit": "Impactos vegetales",
"create.subtitle.saw_activate_wood": "Sierra Mecánica se activa",
"create.subtitle.whistle_high": "UNLOCALIZED: Whistling",
"create.subtitle.haunted_bell_convert": "Campana Embrujada despierta",
"create.subtitle.deny": "Boop denegante",
"create.subtitle.controller_click": "Controlador cliquea",
"create.subtitle.whistle_low": "UNLOCALIZED: Whistling",
"create.subtitle.schematicannon_launch_block": "Esquemacañón dispara",
"create.subtitle.copper_armor_equip": "Equipo de Buceo tintinea",
"create.subtitle.controller_take": "Atril se Vacía",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 225",
"_": "Missing Localizations: 227",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1591,9 +1591,11 @@
"create.subtitle.wrench_rotate": "Llave inglesa usada",
"create.subtitle.potato_hit": "Impacto de vegetal",
"create.subtitle.saw_activate_wood": "Sierra mecánica activada",
"create.subtitle.whistle_high": "UNLOCALIZED: Whistling",
"create.subtitle.haunted_bell_convert": "Campana maldita se despierta",
"create.subtitle.deny": "Pitido denegante",
"create.subtitle.controller_click": "",
"create.subtitle.whistle_low": "UNLOCALIZED: Whistling",
"create.subtitle.schematicannon_launch_block": "Esquematicañón dispara",
"create.subtitle.copper_armor_equip": "Equipo de buceo tintinea",
"create.subtitle.controller_take": "Atril vaciándose",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1794",
"_": "Missing Localizations: 1796",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1591,9 +1591,11 @@
"create.subtitle.wrench_rotate": "UNLOCALIZED: Wrench used",
"create.subtitle.potato_hit": "UNLOCALIZED: Vegetable impacts",
"create.subtitle.saw_activate_wood": "UNLOCALIZED: Mechanical Saw activates",
"create.subtitle.whistle_high": "UNLOCALIZED: Whistling",
"create.subtitle.haunted_bell_convert": "UNLOCALIZED: Haunted Bell awakens",
"create.subtitle.deny": "UNLOCALIZED: Declining boop",
"create.subtitle.controller_click": "UNLOCALIZED: Controller clicks",
"create.subtitle.whistle_low": "UNLOCALIZED: Whistling",
"create.subtitle.schematicannon_launch_block": "Tir de schémacanon",
"create.subtitle.copper_armor_equip": "UNLOCALIZED: Diving equipment clinks",
"create.subtitle.controller_take": "UNLOCALIZED: Lectern empties",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1483",
"_": "Missing Localizations: 1485",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1591,9 +1591,11 @@
"create.subtitle.wrench_rotate": "UNLOCALIZED: Wrench used",
"create.subtitle.potato_hit": "UNLOCALIZED: Vegetable impacts",
"create.subtitle.saw_activate_wood": "UNLOCALIZED: Mechanical Saw activates",
"create.subtitle.whistle_high": "UNLOCALIZED: Whistling",
"create.subtitle.haunted_bell_convert": "UNLOCALIZED: Haunted Bell awakens",
"create.subtitle.deny": "UNLOCALIZED: Declining boop",
"create.subtitle.controller_click": "UNLOCALIZED: Controller clicks",
"create.subtitle.whistle_low": "UNLOCALIZED: Whistling",
"create.subtitle.schematicannon_launch_block": "Tiri del cannoneschematico",
"create.subtitle.copper_armor_equip": "UNLOCALIZED: Diving equipment clinks",
"create.subtitle.controller_take": "UNLOCALIZED: Lectern empties",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 220",
"_": "Missing Localizations: 222",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1591,9 +1591,11 @@
"create.subtitle.wrench_rotate": "レンチが使用される",
"create.subtitle.potato_hit": "野菜の衝撃",
"create.subtitle.saw_activate_wood": "メカニカルソーが動作する",
"create.subtitle.whistle_high": "UNLOCALIZED: Whistling",
"create.subtitle.haunted_bell_convert": "憑りつかれた鐘が目覚める",
"create.subtitle.deny": "失敗音",
"create.subtitle.controller_click": "コントローラーのカチカチ音",
"create.subtitle.whistle_low": "UNLOCALIZED: Whistling",
"create.subtitle.schematicannon_launch_block": "概略図砲が発射する",
"create.subtitle.copper_armor_equip": "潜水服がチャリンと鳴る",
"create.subtitle.controller_take": "書見台が空になる",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 220",
"_": "Missing Localizations: 222",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1591,9 +1591,11 @@
"create.subtitle.wrench_rotate": "렌치를 사용함",
"create.subtitle.potato_hit": "채소가 부딫힘",
"create.subtitle.saw_activate_wood": "톱이 작동함",
"create.subtitle.whistle_high": "UNLOCALIZED: Whistling",
"create.subtitle.haunted_bell_convert": "종에 귀신이 들림",
"create.subtitle.deny": "취소음",
"create.subtitle.controller_click": "조작기를 누름",
"create.subtitle.whistle_low": "UNLOCALIZED: Whistling",
"create.subtitle.schematicannon_launch_block": "청사진 대포가 발사함",
"create.subtitle.copper_armor_equip": "잠수용 장비가 철커덕거림",
"create.subtitle.controller_take": "독서대가 비워짐",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 2146",
"_": "Missing Localizations: 2148",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1591,9 +1591,11 @@
"create.subtitle.wrench_rotate": "UNLOCALIZED: Wrench used",
"create.subtitle.potato_hit": "UNLOCALIZED: Vegetable impacts",
"create.subtitle.saw_activate_wood": "UNLOCALIZED: Mechanical Saw activates",
"create.subtitle.whistle_high": "UNLOCALIZED: Whistling",
"create.subtitle.haunted_bell_convert": "UNLOCALIZED: Haunted Bell awakens",
"create.subtitle.deny": "UNLOCALIZED: Declining boop",
"create.subtitle.controller_click": "UNLOCALIZED: Controller clicks",
"create.subtitle.whistle_low": "UNLOCALIZED: Whistling",
"create.subtitle.schematicannon_launch_block": "UNLOCALIZED: Schematicannon fires",
"create.subtitle.copper_armor_equip": "UNLOCALIZED: Diving equipment clinks",
"create.subtitle.controller_take": "UNLOCALIZED: Lectern empties",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 593",
"_": "Missing Localizations: 595",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1591,9 +1591,11 @@
"create.subtitle.wrench_rotate": "Klucz skrzypi",
"create.subtitle.potato_hit": "Warzywo ląduje",
"create.subtitle.saw_activate_wood": "Mechaniczna piła aktywuje się",
"create.subtitle.whistle_high": "UNLOCALIZED: Whistling",
"create.subtitle.haunted_bell_convert": "Nawiedzony dzwon budzi się",
"create.subtitle.deny": "Dźwięk odmowy",
"create.subtitle.controller_click": "Sterownik klika",
"create.subtitle.whistle_low": "UNLOCALIZED: Whistling",
"create.subtitle.schematicannon_launch_block": "Schematoarmata strzela",
"create.subtitle.copper_armor_equip": "Sprzęt do nurkowania pobrzękuje",
"create.subtitle.controller_take": "Pulpit opróżnia się",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1394",
"_": "Missing Localizations: 1396",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1591,9 +1591,11 @@
"create.subtitle.wrench_rotate": "UNLOCALIZED: Wrench used",
"create.subtitle.potato_hit": "UNLOCALIZED: Vegetable impacts",
"create.subtitle.saw_activate_wood": "UNLOCALIZED: Mechanical Saw activates",
"create.subtitle.whistle_high": "UNLOCALIZED: Whistling",
"create.subtitle.haunted_bell_convert": "UNLOCALIZED: Haunted Bell awakens",
"create.subtitle.deny": "UNLOCALIZED: Declining boop",
"create.subtitle.controller_click": "UNLOCALIZED: Controller clicks",
"create.subtitle.whistle_low": "UNLOCALIZED: Whistling",
"create.subtitle.schematicannon_launch_block": "UNLOCALIZED: Schematicannon fires",
"create.subtitle.copper_armor_equip": "UNLOCALIZED: Diving equipment clinks",
"create.subtitle.controller_take": "UNLOCALIZED: Lectern empties",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1766",
"_": "Missing Localizations: 1768",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1591,9 +1591,11 @@
"create.subtitle.wrench_rotate": "UNLOCALIZED: Wrench used",
"create.subtitle.potato_hit": "UNLOCALIZED: Vegetable impacts",
"create.subtitle.saw_activate_wood": "UNLOCALIZED: Mechanical Saw activates",
"create.subtitle.whistle_high": "UNLOCALIZED: Whistling",
"create.subtitle.haunted_bell_convert": "UNLOCALIZED: Haunted Bell awakens",
"create.subtitle.deny": "UNLOCALIZED: Declining boop",
"create.subtitle.controller_click": "UNLOCALIZED: Controller clicks",
"create.subtitle.whistle_low": "UNLOCALIZED: Whistling",
"create.subtitle.schematicannon_launch_block": "UNLOCALIZED: Schematicannon fires",
"create.subtitle.copper_armor_equip": "UNLOCALIZED: Diving equipment clinks",
"create.subtitle.controller_take": "UNLOCALIZED: Lectern empties",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 221",
"_": "Missing Localizations: 223",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1591,9 +1591,11 @@
"create.subtitle.wrench_rotate": "Cheie folosită",
"create.subtitle.potato_hit": "Impact de legumă",
"create.subtitle.saw_activate_wood": "Ferăstrău Mecanic se activează",
"create.subtitle.whistle_high": "UNLOCALIZED: Whistling",
"create.subtitle.haunted_bell_convert": "Clopot Bântuit se trezețte",
"create.subtitle.deny": "Boop de refuz",
"create.subtitle.controller_click": "Controlor clickuiește",
"create.subtitle.whistle_low": "UNLOCALIZED: Whistling",
"create.subtitle.schematicannon_launch_block": "Tun de Schemă trage",
"create.subtitle.copper_armor_equip": "Echipament de scufundare ciocăne",
"create.subtitle.controller_take": "Pupitru se golește",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 598",
"_": "Missing Localizations: 600",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1591,9 +1591,11 @@
"create.subtitle.wrench_rotate": "Использован гаечный ключ",
"create.subtitle.potato_hit": "Овощ врезается",
"create.subtitle.saw_activate_wood": "Активируется механическая пила",
"create.subtitle.whistle_high": "UNLOCALIZED: Whistling",
"create.subtitle.haunted_bell_convert": "Призрачный колокол пробуждается",
"create.subtitle.deny": "Отрицательный «Буп»",
"create.subtitle.controller_click": "Клики контроллера",
"create.subtitle.whistle_low": "UNLOCALIZED: Whistling",
"create.subtitle.schematicannon_launch_block": "Выстрелы схематичной пушки",
"create.subtitle.copper_armor_equip": "Позвякивание снаряжения для дайвинга",
"create.subtitle.controller_take": "Кафедра опустошается",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 220",
"_": "Missing Localizations: 222",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1591,9 +1591,11 @@
"create.subtitle.wrench_rotate": "扳手:拧动",
"create.subtitle.potato_hit": "土豆:击中",
"create.subtitle.saw_activate_wood": "动力锯:切割",
"create.subtitle.whistle_high": "UNLOCALIZED: Whistling",
"create.subtitle.haunted_bell_convert": "奇异钟:转化",
"create.subtitle.deny": "提示声:出错",
"create.subtitle.controller_click": "遥控器:按下按钮",
"create.subtitle.whistle_low": "UNLOCALIZED: Whistling",
"create.subtitle.schematicannon_launch_block": "蓝图加农炮:发射",
"create.subtitle.copper_armor_equip": "潜水装备:铿锵",
"create.subtitle.controller_take": "讲台:取走物品",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 612",
"_": "Missing Localizations: 614",
"_": "->------------------------] Game Elements [------------------------<-",
@ -1591,9 +1591,11 @@
"create.subtitle.wrench_rotate": "UNLOCALIZED: Wrench used",
"create.subtitle.potato_hit": "食物撞擊聲",
"create.subtitle.saw_activate_wood": "機械鋸子運作聲",
"create.subtitle.whistle_high": "UNLOCALIZED: Whistling",
"create.subtitle.haunted_bell_convert": "靈魂鐘轉化聲",
"create.subtitle.deny": "UNLOCALIZED: Declining boop",
"create.subtitle.controller_click": "遙控器按鍵聲",
"create.subtitle.whistle_low": "UNLOCALIZED: Whistling",
"create.subtitle.schematicannon_launch_block": "藍圖大炮發射",
"create.subtitle.copper_armor_equip": "潛水裝裝備聲",
"create.subtitle.controller_take": "拿下遙控器",

View file

@ -8,6 +8,12 @@
],
"subtitle": "create.subtitle.blaze_munch"
},
"chiff": {
"sounds": [
"create:chiff"
],
"subtitle": "create.subtitle.chiff"
},
"cogs": {
"sounds": [
"create:cogs"
@ -365,6 +371,18 @@
],
"subtitle": "create.subtitle.whistle"
},
"whistle_high": {
"sounds": [
"create:whistle_high"
],
"subtitle": "create.subtitle.whistle_high"
},
"whistle_low": {
"sounds": [
"create:whistle_low"
],
"subtitle": "create.subtitle.whistle_low"
},
"worldshaper_place": {
"sounds": [
{

View file

@ -223,10 +223,22 @@ public class AllSoundEvents {
.category(SoundSource.BLOCKS)
.build(),
WHISTLE_HIGH = create("whistle_high").subtitle("Whistling")
.category(SoundSource.RECORDS)
.build(),
WHISTLE = create("whistle").subtitle("Whistling")
.category(SoundSource.RECORDS)
.build(),
WHISTLE_LOW = create("whistle_low").subtitle("Whistling")
.category(SoundSource.RECORDS)
.build(),
WHISTLE_CHIFF = create("chiff").noSubtitle()
.category(SoundSource.RECORDS)
.build(),
HAUNTED_BELL_CONVERT = create("haunted_bell_convert").subtitle("Haunted Bell awakens")
.category(SoundSource.BLOCKS)
.build(),
@ -265,7 +277,7 @@ public class AllSoundEvents {
public static SoundEntryProvider provider(DataGenerator generator) {
return new SoundEntryProvider(generator);
}
public static void playItemPickup(Player player) {
player.level.playSound(null, player.blockPosition(), SoundEvents.ITEM_PICKUP, SoundSource.PLAYERS, .2f,
1f + Create.RANDOM.nextFloat());
@ -463,8 +475,8 @@ public class AllSoundEvents {
private List<Pair<SoundEvent, Couple<Float>>> wrappedEvents;
private List<Pair<SoundEvent, Couple<Float>>> compiledEvents;
public WrappedSoundEntry(ResourceLocation id, String subtitle, List<Pair<SoundEvent, Couple<Float>>> wrappedEvents,
SoundSource category) {
public WrappedSoundEntry(ResourceLocation id, String subtitle,
List<Pair<SoundEvent, Couple<Float>>> wrappedEvents, SoundSource category) {
super(id, subtitle, category);
this.wrappedEvents = wrappedEvents;
compiledEvents = Lists.newArrayList();
@ -539,7 +551,8 @@ public class AllSoundEvents {
protected List<ResourceLocation> variants;
protected SoundEvent event;
public CustomSoundEntry(ResourceLocation id, List<ResourceLocation> variants, String subtitle, SoundSource category) {
public CustomSoundEntry(ResourceLocation id, List<ResourceLocation> variants, String subtitle,
SoundSource category) {
super(id, subtitle, category);
this.variants = variants;
}

View file

@ -17,7 +17,7 @@ import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.RenderShape;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
@ -58,7 +58,12 @@ public class PoweredShaftBlock extends AbstractShaftBlock {
return AllBlocks.SHAFT.asStack();
}
public static boolean stillValid(BlockState pState, LevelAccessor pLevel, BlockPos pPos) {
@Override
public boolean canSurvive(BlockState pState, LevelReader pLevel, BlockPos pPos) {
return stillValid(pState, pLevel, pPos);
}
public static boolean stillValid(BlockState pState, LevelReader pLevel, BlockPos pPos) {
for (Direction d : Iterate.directions) {
if (d.getAxis() == pState.getValue(AXIS))
continue;

View file

@ -67,7 +67,7 @@ public class PoweredShaftTileEntity extends GeneratingKineticTileEntity {
@Override
protected void write(CompoundTag compound, boolean clientPacket) {
compound.putInt("Direction", movementDirection);
if (enginePos != null) {
if (enginePos != null && capacityKey != null) {
compound.put("EnginePos", NbtUtils.writeBlockPos(enginePos));
compound.putFloat("EnginePower", engineEfficiency);
compound.putString("EngineType", capacityKey.getRegistryName().toString());

View file

@ -15,6 +15,9 @@ import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Direction.Axis;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.StringRepresentable;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
@ -29,6 +32,7 @@ import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.Mirror;
import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition.Builder;
@ -121,14 +125,24 @@ public class WhistleBlock extends Block implements ITE<WhistleTileEntity>, IWren
if (!base.hasProperty(SIZE))
return;
WhistleSize size = base.getValue(SIZE);
SoundType soundtype = base.getSoundType();
BlockPos currentPos = pPos.above();
for (int i = 1; i <= 12; i++) {
for (int i = 1; i <= 6; i++) {
BlockState blockState = pLevel.getBlockState(currentPos);
float pVolume = (soundtype.getVolume() + 1.0F) / 2.0F;
SoundEvent growSound = SoundEvents.NOTE_BLOCK_XYLOPHONE;
SoundEvent hitSound = soundtype.getHitSound();
if (AllBlocks.STEAM_WHISTLE_EXTENSION.has(blockState)) {
if (blockState.getValue(WhistleExtenderBlock.SHAPE) == WhistleExtenderShape.SINGLE) {
pLevel.setBlock(currentPos,
blockState.setValue(WhistleExtenderBlock.SHAPE, WhistleExtenderShape.DOUBLE), 3);
if (soundtype != null) {
float pPitch = (float) Math.pow(2, -(i * 2) / 12.0);
pLevel.playSound(null, currentPos, growSound, SoundSource.BLOCKS, pVolume / 4f, pPitch);
pLevel.playSound(null, currentPos, hitSound, SoundSource.BLOCKS, pVolume, pPitch);
}
return;
}
currentPos = currentPos.above();
@ -141,6 +155,11 @@ public class WhistleBlock extends Block implements ITE<WhistleTileEntity>, IWren
pLevel.setBlock(currentPos, AllBlocks.STEAM_WHISTLE_EXTENSION.getDefaultState()
.setValue(SIZE, size), 3);
if (soundtype != null) {
float pPitch = (float) Math.pow(2, -(i * 2 - 1) / 12.0);
pLevel.playSound(null, currentPos, growSound, SoundSource.BLOCKS, pVolume / 4f, pPitch);
pLevel.playSound(null, currentPos, hitSound, SoundSource.BLOCKS, pVolume, pPitch);
}
return;
}
}

View file

@ -1,6 +1,7 @@
package com.simibubi.create.content.contraptions.components.steam.whistle;
import com.simibubi.create.AllSoundEvents;
import com.simibubi.create.content.contraptions.components.steam.whistle.WhistleBlock.WhistleSize;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.sounds.AbstractTickableSoundInstance;
@ -13,9 +14,14 @@ public class WhistleSoundInstance extends AbstractTickableSoundInstance {
private boolean active;
private int keepAlive;
private WhistleSize size;
public WhistleSoundInstance(BlockPos worldPosition) {
super(AllSoundEvents.WHISTLE.getMainEvent(), SoundSource.RECORDS);
public WhistleSoundInstance(WhistleSize size, BlockPos worldPosition) {
super(
(size == WhistleSize.SMALL ? AllSoundEvents.WHISTLE_HIGH
: size == WhistleSize.MEDIUM ? AllSoundEvents.WHISTLE : AllSoundEvents.WHISTLE_LOW).getMainEvent(),
SoundSource.RECORDS);
this.size = size;
looping = true;
active = true;
volume = 0.05f;
@ -27,6 +33,10 @@ public class WhistleSoundInstance extends AbstractTickableSoundInstance {
z = v.z;
}
public WhistleSize getOctave() {
return size;
}
public void fadeOut() {
this.active = false;
}
@ -42,7 +52,7 @@ public class WhistleSoundInstance extends AbstractTickableSoundInstance {
@Override
public void tick() {
Vec3 eyePosition = Minecraft.getInstance().cameraEntity.getEyePosition();
float maxVolume = (float) Mth.clamp((30 - eyePosition.distanceTo(new Vec3(x, y, z))) / 30, 0, 1);
float maxVolume = (float) Mth.clamp((30 - eyePosition.distanceTo(new Vec3(x, y, z))) / 30, 0, .75f);
if (active) {
volume = Math.min(1, volume + .25f);
volume = Math.min(volume, maxVolume);
@ -50,6 +60,7 @@ public class WhistleSoundInstance extends AbstractTickableSoundInstance {
if (keepAlive == 0)
fadeOut();
return;
}
volume = Math.max(0, volume - .25f);
volume = Math.min(volume, maxVolume);

View file

@ -4,23 +4,30 @@ 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.components.steam.SteamJetParticleData;
import com.simibubi.create.content.contraptions.components.steam.whistle.WhistleBlock.WhistleSize;
import com.simibubi.create.content.contraptions.components.steam.whistle.WhistleExtenderBlock.WhistleExtenderShape;
import com.simibubi.create.content.contraptions.fluids.tank.FluidTankConnectivityHandler;
import com.simibubi.create.content.contraptions.fluids.tank.FluidTankTileEntity;
import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.VecHelper;
import com.simibubi.create.foundation.utility.animation.LerpedFloat;
import com.simibubi.create.foundation.utility.animation.LerpedFloat.Chaser;
import net.minecraft.client.Minecraft;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Direction.Axis;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.DistExecutor;
@ -66,10 +73,10 @@ public class WhistleTileEntity extends SmartTileEntity implements IHaveGoggleInf
FluidTankTileEntity tank = getTank();
boolean powered = isPowered() && tank != null && tank.boiler.isActive()
&& tank.boiler.getEngineEfficiency(tank.getTotalTankSize()) > 0;
&& (tank.boiler.passiveHeat || tank.boiler.activeHeat > 0);
animation.chase(powered ? 1 : 0, powered ? .5f : .4f, powered ? Chaser.EXP : Chaser.LINEAR);
animation.tickChaser();
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> this.tickAudio(powered));
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> this.tickAudio(getOctave(), powered));
}
@Override
@ -96,11 +103,16 @@ public class WhistleTileEntity extends SmartTileEntity implements IHaveGoggleInf
.orElse(false);
}
protected WhistleSize getOctave() {
return getBlockState().getOptionalValue(WhistleBlock.SIZE)
.orElse(WhistleSize.MEDIUM);
}
@OnlyIn(Dist.CLIENT)
protected WhistleSoundInstance soundInstance;
@OnlyIn(Dist.CLIENT)
protected void tickAudio(boolean powered) {
protected void tickAudio(WhistleSize size, boolean powered) {
if (!powered) {
if (soundInstance != null) {
soundInstance.fadeOut();
@ -109,14 +121,35 @@ public class WhistleTileEntity extends SmartTileEntity implements IHaveGoggleInf
return;
}
if (soundInstance == null || soundInstance.isStopped())
float f = (float) Math.pow(2, -pitch / 12.0);
boolean particle = level.getGameTime() % 8 == 0;
if (soundInstance == null || soundInstance.isStopped() || soundInstance.getOctave() != size) {
Minecraft.getInstance()
.getSoundManager()
.play(soundInstance = new WhistleSoundInstance(worldPosition));
.play(soundInstance = new WhistleSoundInstance(size, worldPosition));
AllSoundEvents.WHISTLE_CHIFF.playAt(level, worldPosition, 0.25f, size == WhistleSize.SMALL ? f + .75f : f,
true);
particle = true;
}
float f = (float) Math.pow(2.0D, (double) ((24 - pitch) - 12) / 12.0D);
soundInstance.keepAlive();
soundInstance.setPitch(f);
if (!particle)
return;
Direction facing = getBlockState().getOptionalValue(WhistleBlock.FACING)
.orElse(Direction.SOUTH);
float angle = 180 + AngleHelper.horizontalAngle(facing);
Vec3 sizeOffset = VecHelper.rotate(new Vec3(0, -0.4f, 1 / 16f * size.ordinal()), angle, Axis.Y);
Vec3 offset = VecHelper.rotate(new Vec3(0, 1, 0.75f), angle, Axis.Y);
Vec3 v = offset.scale(.45f)
.add(sizeOffset)
.add(Vec3.atCenterOf(worldPosition));
Vec3 m = offset.subtract(Vec3.atLowerCornerOf(facing.getNormal())
.scale(.75f));
level.addParticle(new SteamJetParticleData(1), v.x, v.y, v.z, m.x, m.y, m.z);
}
public FluidTankTileEntity getTank() {

View file

@ -23,8 +23,8 @@
},
{
"name": "Pipe Large",
"from": [4, 5, 4],
"to": [12, 13, 13],
"from": [4, 3, 4],
"to": [12, 11, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [7, 0.5, 11, 4.5], "rotation": 180, "texture": "#1"},

View file

@ -23,8 +23,8 @@
},
{
"name": "Pipe Medium",
"from": [5, 5, 5],
"to": [11, 11, 13],
"from": [5, 3, 5],
"to": [11, 9, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [7.5, 1, 10.5, 4], "rotation": 180, "texture": "#1"},

View file

@ -23,8 +23,8 @@
},
{
"name": "Pipe Small",
"from": [6, 6, 6],
"to": [10, 10, 13],
"from": [6, 3, 6],
"to": [10, 7, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [8, 1.5, 10, 3.5], "rotation": 180, "texture": "#1"},

Binary file not shown.