From 7c81947a8d7da5c96b19ea671e7ce5bd7f29d75b Mon Sep 17 00:00:00 2001 From: NewJumper Date: Tue, 20 Aug 2024 19:31:01 -0500 Subject: [PATCH] added stalker notice sound subtitles --- .../.cache/5e6a331e51b12074ee68391963c1cb803c27d050 | 4 ++-- .../.cache/735031f3addf80804addae5e3f53249900116f1e | 4 ++-- .../resources/assets/deeperdarker/lang/en_us.json | 1 + .../resources/assets/deeperdarker/sounds.json | 11 +++++++++++ .../com/kyanite/deeperdarker/content/DDSounds.java | 3 ++- .../deeperdarker/content/entities/Shattered.java | 5 +++-- .../deeperdarker/content/entities/Stalker.java | 3 +-- .../datagen/assets/DDSoundDefinitions.java | 11 ++++++----- .../datagen/assets/ENLanguageProvider.java | 1 + 9 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/generated/resources/.cache/5e6a331e51b12074ee68391963c1cb803c27d050 b/src/generated/resources/.cache/5e6a331e51b12074ee68391963c1cb803c27d050 index 16ce68a84..68a874eab 100644 --- a/src/generated/resources/.cache/5e6a331e51b12074ee68391963c1cb803c27d050 +++ b/src/generated/resources/.cache/5e6a331e51b12074ee68391963c1cb803c27d050 @@ -1,2 +1,2 @@ -// 1.21 2024-08-20T17:04:58.8202874 Languages: en_us for mod: deeperdarker -cb9bfc49a8f622e909c1963cb4006a4703852713 assets/deeperdarker/lang/en_us.json +// 1.21 2024-08-20T19:27:23.4940439 Languages: en_us for mod: deeperdarker +49fe2444fa2877b2994cdd4aac39804214a38e5f assets/deeperdarker/lang/en_us.json diff --git a/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e b/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e index 6796946da..07b2f447b 100644 --- a/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e +++ b/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e @@ -1,2 +1,2 @@ -// 1.21 2024-08-20T17:01:41.2820268 Sound Definitions -945abb0f69d9cfdea8808e45af287b12373c3ccd assets/deeperdarker/sounds.json +// 1.21 2024-08-20T19:27:23.5001919 Sound Definitions +9b35e0f88e7d8fc25f3f37bb64b27d8691ca9557 assets/deeperdarker/sounds.json diff --git a/src/generated/resources/assets/deeperdarker/lang/en_us.json b/src/generated/resources/assets/deeperdarker/lang/en_us.json index efecc3932..559adba49 100644 --- a/src/generated/resources/assets/deeperdarker/lang/en_us.json +++ b/src/generated/resources/assets/deeperdarker/lang/en_us.json @@ -281,6 +281,7 @@ "subtitles.entity.stalker.ambient": "Stalker chirps", "subtitles.entity.stalker.death": "Stalker dies", "subtitles.entity.stalker.hurt": "Stalker hurts", + "subtitles.entity.stalker.notice": "Stalker notices", "subtitles.item.transmitter.error": "Transmitter fails", "subtitles.item.transmitter.link": "Transmitter links", "subtitles.item.transmitter.open": "Transmitter transmits", diff --git a/src/generated/resources/assets/deeperdarker/sounds.json b/src/generated/resources/assets/deeperdarker/sounds.json index 35d008916..b549386c1 100644 --- a/src/generated/resources/assets/deeperdarker/sounds.json +++ b/src/generated/resources/assets/deeperdarker/sounds.json @@ -222,6 +222,17 @@ ], "subtitle": "subtitles.entity.stalker.hurt" }, + "entity.stalker.notice": { + "sounds": [ + "mob/warden/tendril_clicks_1", + "mob/warden/tendril_clicks_2", + "mob/warden/tendril_clicks_3", + "mob/warden/tendril_clicks_4", + "mob/warden/tendril_clicks_5", + "mob/warden/tendril_clicks_6" + ], + "subtitle": "subtitles.entity.stalker.notice" + }, "item.transmitter.error": { "sounds": [ "deeperdarker:item/transmitter/error" diff --git a/src/main/java/com/kyanite/deeperdarker/content/DDSounds.java b/src/main/java/com/kyanite/deeperdarker/content/DDSounds.java index e04c4cb83..dbf5d392b 100644 --- a/src/main/java/com/kyanite/deeperdarker/content/DDSounds.java +++ b/src/main/java/com/kyanite/deeperdarker/content/DDSounds.java @@ -41,7 +41,7 @@ public class DDSounds { public static final DeferredHolder SHATTERED_AMBIENT = register("entity.shattered.ambient"); public static final DeferredHolder SHATTERED_DEATH = register("entity.shattered.death"); public static final DeferredHolder SHATTERED_HURT = register("entity.shattered.hurt"); - public static final DeferredHolder SHATTERED_NOTICES = register("entity.shattered.notice"); + public static final DeferredHolder SHATTERED_NOTICE = register("entity.shattered.notice"); public static final DeferredHolder SHRIEK_WORM_AMBIENT = register("entity.shriek_worm.ambient"); public static final DeferredHolder SHRIEK_WORM_DEATH = register("entity.shriek_worm.death"); @@ -50,6 +50,7 @@ public class DDSounds { public static final DeferredHolder STALKER_AMBIENT = register("entity.stalker.ambient"); public static final DeferredHolder STALKER_DEATH = register("entity.stalker.death"); public static final DeferredHolder STALKER_HURT = register("entity.stalker.hurt"); + public static final DeferredHolder STALKER_NOTICE = register("entity.stalker.notice"); public static final DeferredHolder TRANSMITTER_ERROR = register("item.transmitter.error"); public static final DeferredHolder TRANSMITTER_LINK = register("item.transmitter.link"); diff --git a/src/main/java/com/kyanite/deeperdarker/content/entities/Shattered.java b/src/main/java/com/kyanite/deeperdarker/content/entities/Shattered.java index 278c3370d..8ebd21ddb 100644 --- a/src/main/java/com/kyanite/deeperdarker/content/entities/Shattered.java +++ b/src/main/java/com/kyanite/deeperdarker/content/entities/Shattered.java @@ -4,7 +4,6 @@ import com.kyanite.deeperdarker.content.entities.goals.DisturbanceGoal; import com.kyanite.deeperdarker.content.entities.goals.DisturbanceListener; import com.kyanite.deeperdarker.util.DDTags; -import java.util.function.BiConsumer; import net.minecraft.core.BlockPos; import net.minecraft.core.Holder; import net.minecraft.server.level.ServerLevel; @@ -30,6 +29,8 @@ import net.minecraft.world.level.gameevent.vibrations.VibrationSystem; import net.minecraft.world.level.pathfinder.PathType; +import java.util.function.BiConsumer; + @SuppressWarnings("NullableProblems") public class Shattered extends Monster implements DisturbanceListener, VibrationSystem { public final AnimationState idleState = new AnimationState(); @@ -180,7 +181,7 @@ public boolean canReceiveVibration(ServerLevel level, BlockPos pPos, Holder gameEvent, Entity entity, Entity playerEntity, float distance) { if(isDeadOrDying()) return; - playSound(DDSounds.SHATTERED_NOTICES.get(), 2, 1); + playSound(DDSounds.SHATTERED_NOTICE.get(), 2, 1); if(entity != null && canTargetEntity(entity)) { if(entity instanceof LivingEntity target && !target.getType().is(DDTags.Misc.SCULK)) setTarget(target); return; diff --git a/src/main/java/com/kyanite/deeperdarker/content/entities/Stalker.java b/src/main/java/com/kyanite/deeperdarker/content/entities/Stalker.java index 29fdd9cf2..ce36a3462 100644 --- a/src/main/java/com/kyanite/deeperdarker/content/entities/Stalker.java +++ b/src/main/java/com/kyanite/deeperdarker/content/entities/Stalker.java @@ -16,7 +16,6 @@ import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundEvent; -import net.minecraft.sounds.SoundEvents; import net.minecraft.tags.GameEventTags; import net.minecraft.tags.TagKey; import net.minecraft.world.BossEvent; @@ -284,7 +283,7 @@ public boolean canReceiveVibration(ServerLevel level, BlockPos pPos, Holder gameEvent, @Nullable Entity entity, @Nullable Entity playerEntity, float distance) { if(isDeadOrDying()) return; - playSound(SoundEvents.WARDEN_TENDRIL_CLICKS, 2, 1); + playSound(DDSounds.STALKER_NOTICE.get(), 2, 1); if(entity != null && canTargetEntity(entity)) { if(entity instanceof LivingEntity target && !target.getType().is(DDTags.Misc.SCULK)) setTarget(target); return; diff --git a/src/main/java/com/kyanite/deeperdarker/datagen/assets/DDSoundDefinitions.java b/src/main/java/com/kyanite/deeperdarker/datagen/assets/DDSoundDefinitions.java index 5465a49de..3bf897d28 100644 --- a/src/main/java/com/kyanite/deeperdarker/datagen/assets/DDSoundDefinitions.java +++ b/src/main/java/com/kyanite/deeperdarker/datagen/assets/DDSoundDefinitions.java @@ -38,13 +38,14 @@ public void registerSounds() { add(DDSounds.SHATTERED_AMBIENT, subtitle("entity.shattered.ambient").with(sound("entity/shattered/ambient1"), sound("entity/shattered/ambient2"), sound("entity/shattered/ambient3"))); add(DDSounds.SHATTERED_DEATH, subtitle("entity.shattered.death").with(sound("entity/shattered/death"))); add(DDSounds.SHATTERED_HURT, subtitle("entity.shattered.hurt").with(sound("entity/shattered/hurt1"), sound("entity/shattered/hurt2"), sound("entity/shattered/hurt3"))); - add(DDSounds.SHATTERED_NOTICES, subtitle("entity.shattered.notice").with(vanillaSound("mob/warden/tendril_clicks_1"), vanillaSound("mob/warden/tendril_clicks_2"), vanillaSound("mob/warden/tendril_clicks_3"), vanillaSound("mob/warden/tendril_clicks_4"), vanillaSound("mob/warden/tendril_clicks_5"), vanillaSound("mob/warden/tendril_clicks_6"))); + add(DDSounds.SHATTERED_NOTICE, subtitle("entity.shattered.notice").with(mcSound("mob/warden/tendril_clicks_1"), mcSound("mob/warden/tendril_clicks_2"), mcSound("mob/warden/tendril_clicks_3"), mcSound("mob/warden/tendril_clicks_4"), mcSound("mob/warden/tendril_clicks_5"), mcSound("mob/warden/tendril_clicks_6"))); add(DDSounds.SHRIEK_WORM_AMBIENT, subtitle("entity.shriek_worm.ambient").with(sound("entity/shriek_worm/ambient1"), sound("entity/shriek_worm/ambient2"), sound("entity/shriek_worm/ambient3"))); add(DDSounds.SHRIEK_WORM_DEATH, subtitle("entity.shriek_worm.death").with(sound("entity/shriek_worm/death"))); add(DDSounds.SHRIEK_WORM_HURT, subtitle("entity.shriek_worm.hurt").with(sound("entity/shriek_worm/hurt1"), sound("entity/shriek_worm/hurt2"), sound("entity/shriek_worm/hurt3"))); add(DDSounds.STALKER_AMBIENT, subtitle("entity.stalker.ambient").with(sound("entity/stalker/ambient1"), sound("entity/stalker/ambient2"), sound("entity/stalker/ambient3"))); add(DDSounds.STALKER_DEATH, subtitle("entity.stalker.death").with(sound("entity/stalker/death"))); add(DDSounds.STALKER_HURT, subtitle("entity.stalker.hurt").with(sound("entity/stalker/hurt1"), sound("entity/stalker/hurt2"), sound("entity/stalker/hurt3"), sound("entity/stalker/hurt4"))); + add(DDSounds.STALKER_NOTICE, subtitle("entity.stalker.notice").with(mcSound("mob/warden/tendril_clicks_1"), mcSound("mob/warden/tendril_clicks_2"), mcSound("mob/warden/tendril_clicks_3"), mcSound("mob/warden/tendril_clicks_4"), mcSound("mob/warden/tendril_clicks_5"), mcSound("mob/warden/tendril_clicks_6"))); add(DDSounds.TRANSMITTER_ERROR, subtitle("item.transmitter.error").with(sound("item/transmitter/error"))); add(DDSounds.TRANSMITTER_LINK, subtitle("item.transmitter.link").with(sound("item/transmitter/link"))); add(DDSounds.TRANSMITTER_OPEN, subtitle("item.transmitter.open").with(sound("item/transmitter/open"))); @@ -55,11 +56,11 @@ private SoundDefinition subtitle(String subtitle) { return definition().subtitle("subtitles." + subtitle); } - protected static SoundDefinition.Sound vanillaSound(String location) { - return sound(ResourceLocation.fromNamespaceAndPath("minecraft", location)); - } - protected static SoundDefinition.Sound sound(String location) { return sound(DeeperDarker.rl(location)); } + + private static SoundDefinition.Sound mcSound(String location) { + return sound(ResourceLocation.withDefaultNamespace(location)); + } } diff --git a/src/main/java/com/kyanite/deeperdarker/datagen/assets/ENLanguageProvider.java b/src/main/java/com/kyanite/deeperdarker/datagen/assets/ENLanguageProvider.java index 82f3b66e3..be219e7ec 100644 --- a/src/main/java/com/kyanite/deeperdarker/datagen/assets/ENLanguageProvider.java +++ b/src/main/java/com/kyanite/deeperdarker/datagen/assets/ENLanguageProvider.java @@ -124,6 +124,7 @@ protected void addTranslations() { add("subtitles.entity.stalker.ambient", "Stalker chirps"); add("subtitles.entity.stalker.death", "Stalker dies"); add("subtitles.entity.stalker.hurt", "Stalker hurts"); + add("subtitles.entity.stalker.notice", "Stalker notices"); add("subtitles.item.transmitter.error", "Transmitter fails"); add("subtitles.item.transmitter.link", "Transmitter links"); add("subtitles.item.transmitter.open", "Transmitter transmits");