Skip to content

Commit

Permalink
added stalker notice sound subtitles
Browse files Browse the repository at this point in the history
  • Loading branch information
NewJumper committed Aug 21, 2024
1 parent 85ccb00 commit 7c81947
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 11 additions & 0 deletions src/generated/resources/assets/deeperdarker/sounds.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/kyanite/deeperdarker/content/DDSounds.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class DDSounds {
public static final DeferredHolder<SoundEvent, SoundEvent> SHATTERED_AMBIENT = register("entity.shattered.ambient");
public static final DeferredHolder<SoundEvent, SoundEvent> SHATTERED_DEATH = register("entity.shattered.death");
public static final DeferredHolder<SoundEvent, SoundEvent> SHATTERED_HURT = register("entity.shattered.hurt");
public static final DeferredHolder<SoundEvent, SoundEvent> SHATTERED_NOTICES = register("entity.shattered.notice");
public static final DeferredHolder<SoundEvent, SoundEvent> SHATTERED_NOTICE = register("entity.shattered.notice");

public static final DeferredHolder<SoundEvent, SoundEvent> SHRIEK_WORM_AMBIENT = register("entity.shriek_worm.ambient");
public static final DeferredHolder<SoundEvent, SoundEvent> SHRIEK_WORM_DEATH = register("entity.shriek_worm.death");
Expand All @@ -50,6 +50,7 @@ public class DDSounds {
public static final DeferredHolder<SoundEvent, SoundEvent> STALKER_AMBIENT = register("entity.stalker.ambient");
public static final DeferredHolder<SoundEvent, SoundEvent> STALKER_DEATH = register("entity.stalker.death");
public static final DeferredHolder<SoundEvent, SoundEvent> STALKER_HURT = register("entity.stalker.hurt");
public static final DeferredHolder<SoundEvent, SoundEvent> STALKER_NOTICE = register("entity.stalker.notice");

public static final DeferredHolder<SoundEvent, SoundEvent> TRANSMITTER_ERROR = register("item.transmitter.error");
public static final DeferredHolder<SoundEvent, SoundEvent> TRANSMITTER_LINK = register("item.transmitter.link");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down Expand Up @@ -180,7 +181,7 @@ public boolean canReceiveVibration(ServerLevel level, BlockPos pPos, Holder<Game
@Override
public void onReceiveVibration(ServerLevel level, BlockPos pos, Holder<GameEvent> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -284,7 +283,7 @@ public boolean canReceiveVibration(ServerLevel level, BlockPos pPos, Holder<Game
@Override
public void onReceiveVibration(ServerLevel level, BlockPos pPos, Holder<GameEvent> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
Expand All @@ -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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 7c81947

Please sign in to comment.