diff --git a/src/main/java/com/kd8lvt/exclusionzone/ExclusionZone.java b/src/main/java/com/kd8lvt/exclusionzone/ExclusionZone.java index 7ded9e5..2e03816 100644 --- a/src/main/java/com/kd8lvt/exclusionzone/ExclusionZone.java +++ b/src/main/java/com/kd8lvt/exclusionzone/ExclusionZone.java @@ -32,7 +32,6 @@ public class ExclusionZone implements ModInitializer { public static MinecraftServer Server = null; public static final boolean muttering_debug = false; public static final ToxicBuildupTracker toxTracker = new ToxicBuildupTracker(); - @Override public void onInitialize() { // This code runs as soon as Minecraft is in a mod-load-ready state. @@ -49,7 +48,6 @@ public void onInitialize() { ModPotions.register(); LOGGER.info("[ExclusionZone] Registrering Entities..."); ModEntities.register(); - ResourceManagerHelper.get(ResourceType.SERVER_DATA).registerReloadListener(new SimpleSynchronousResourceReloadListener() { @Override public Identifier getFabricId() { @@ -71,7 +69,7 @@ public void reload(ResourceManager manager) { ServerPlayConnectionEvents.DISCONNECT.register((handler, server) -> toxTracker.remove(handler.getPlayer())); - ServerTickEvents.END_SERVER_TICK.register(server -> toxTracker.onTick(server)); + ServerTickEvents.END_SERVER_TICK.register(toxTracker::onTick); } public static void runCommand(String cmd) { diff --git a/src/main/java/com/kd8lvt/exclusionzone/init/Items/CaroInvictusSummoner.java b/src/main/java/com/kd8lvt/exclusionzone/init/Items/CaroInvictusSummoner.java index 877d985..b80646f 100644 --- a/src/main/java/com/kd8lvt/exclusionzone/init/Items/CaroInvictusSummoner.java +++ b/src/main/java/com/kd8lvt/exclusionzone/init/Items/CaroInvictusSummoner.java @@ -27,7 +27,7 @@ public ActionResult useOnBlock(ItemUsageContext context) { if (!Objects.requireNonNull(context.getPlayer()).isSneaking()) return super.useOnBlock(context); if (((BeaconBlockEntity) Objects.requireNonNull(w.getBlockEntity(context.getBlockPos()))).getBeamSegments().isEmpty()) return super.useOnBlock(context); - w.playSoundAtBlockCenter(context.getBlockPos().up(), ModSounds.CARO_INVICTUS_MUSIC_EVENT, SoundCategory.MASTER,1.0f,1.0f,true); + w.playSoundAtBlockCenter(context.getBlockPos().up(), ModSounds.CARO_INVICTUS_MUSIC, SoundCategory.MASTER,1.0f,1.0f,true); if (w.isClient) return super.useOnBlock(context); ServerWorld world = (ServerWorld)w; diff --git a/src/main/java/com/kd8lvt/exclusionzone/init/Items/Dolls/BoyDoll.java b/src/main/java/com/kd8lvt/exclusionzone/init/Items/Dolls/BoyDoll.java index cb57c51..8c221e5 100644 --- a/src/main/java/com/kd8lvt/exclusionzone/init/Items/Dolls/BoyDoll.java +++ b/src/main/java/com/kd8lvt/exclusionzone/init/Items/Dolls/BoyDoll.java @@ -8,7 +8,7 @@ public class BoyDoll extends Doll { public BoyDoll() { - super(ModSounds.DOLL_SQUEAK_EVENT,ModSounds.DOLL_CHICKEN_EVENT,0.2, "rubber chicken"); + super(ModSounds.DOLL_SQUEAK,ModSounds.DOLL_CHICKEN,0.2, "rubber chicken"); this.tt.addAll(Text.of("Research Notes").getWithStyle(Style.EMPTY.withColor(TextColor.parse("gray").getOrThrow()))); this.tt.addAll(Text.of("A discarded children's toy.").getWithStyle(Style.EMPTY.withColor(TextColor.parse("gray").getOrThrow()))); this.tt.addAll(Text.of("Judging from the colors, this one appears to be a boy.").getWithStyle(Style.EMPTY.withColor(TextColor.parse("gray").getOrThrow()))); diff --git a/src/main/java/com/kd8lvt/exclusionzone/init/Items/Dolls/GirlDoll.java b/src/main/java/com/kd8lvt/exclusionzone/init/Items/Dolls/GirlDoll.java index be3cc7b..8d10fbe 100644 --- a/src/main/java/com/kd8lvt/exclusionzone/init/Items/Dolls/GirlDoll.java +++ b/src/main/java/com/kd8lvt/exclusionzone/init/Items/Dolls/GirlDoll.java @@ -8,7 +8,7 @@ public class GirlDoll extends Doll { public GirlDoll() { - super(ModSounds.DOLL_SQUEAK_EVENT,ModSounds.DOLL_CHICKEN_EVENT,0.2); + super(ModSounds.DOLL_SQUEAK,ModSounds.DOLL_CHICKEN,0.2); this.tt.addAll(Text.of("Research Notes").getWithStyle(Style.EMPTY.withColor(TextColor.parse("gray").getOrThrow()))); this.tt.addAll(Text.of("A discarded children's toy.").getWithStyle(Style.EMPTY.withColor(TextColor.parse("gray").getOrThrow()))); this.tt.addAll(Text.of("Judging from the colors, this one appears to be a girl.").getWithStyle(Style.EMPTY.withColor(TextColor.parse("gray").getOrThrow()))); diff --git a/src/main/java/com/kd8lvt/exclusionzone/init/Items/Dolls/VillagerDoll.java b/src/main/java/com/kd8lvt/exclusionzone/init/Items/Dolls/VillagerDoll.java index 70fae87..a86adee 100644 --- a/src/main/java/com/kd8lvt/exclusionzone/init/Items/Dolls/VillagerDoll.java +++ b/src/main/java/com/kd8lvt/exclusionzone/init/Items/Dolls/VillagerDoll.java @@ -8,7 +8,7 @@ public class VillagerDoll extends Doll { public VillagerDoll() { - super(ModSounds.DOLL_SQUEAK_EVENT,ModSounds.DOLL_CHICKEN_EVENT,0.2); + super(ModSounds.DOLL_SQUEAK,ModSounds.DOLL_CHICKEN,0.2); this.tt.addAll(Text.of("Research Notes").getWithStyle(Style.EMPTY.withColor(TextColor.parse("gray").getOrThrow()))); this.tt.addAll(Text.of("A discarded children's toy.").getWithStyle(Style.EMPTY.withColor(TextColor.parse("gray").getOrThrow()))); this.tt.addAll(Text.of("This one has a suspiciously villager-like nose!.").getWithStyle(Style.EMPTY.withColor(TextColor.parse("gray").getOrThrow()))); diff --git a/src/main/java/com/kd8lvt/exclusionzone/init/ModSounds.java b/src/main/java/com/kd8lvt/exclusionzone/init/ModSounds.java index 047b8a5..016827b 100644 --- a/src/main/java/com/kd8lvt/exclusionzone/init/ModSounds.java +++ b/src/main/java/com/kd8lvt/exclusionzone/init/ModSounds.java @@ -7,18 +7,27 @@ import net.minecraft.util.Identifier; public class ModSounds { - public static final Identifier DOLL_SQUEAK = ExclusionZone.id("item.doll.squeak"); - public static SoundEvent DOLL_SQUEAK_EVENT = SoundEvent.of(DOLL_SQUEAK); + public static SoundEvent DOLL_SQUEAK; + public static SoundEvent DOLL_CHICKEN; + public static SoundEvent CARO_INVICTUS_MUSIC; + public static SoundEvent EZ_DRONE_TS_SLOWED; + public static SoundEvent EZ_DRONE_TS_SLOWED_GEIGER; + public static SoundEvent EZ_DRONE_TS_SLOWED_VOICES; - public static final Identifier DOLL_CHICKEN = ExclusionZone.id("item.doll.chicken"); - public static SoundEvent DOLL_CHICKEN_EVENT = SoundEvent.of(DOLL_CHICKEN); - - public static final Identifier CARO_INVICTUS_MUSIC = ExclusionZone.id("mob.caro_invictus.music"); - public static SoundEvent CARO_INVICTUS_MUSIC_EVENT = SoundEvent.of(CARO_INVICTUS_MUSIC); public static void register() { - Registry.register(Registries.SOUND_EVENT,DOLL_SQUEAK,DOLL_SQUEAK_EVENT); - Registry.register(Registries.SOUND_EVENT,DOLL_CHICKEN,DOLL_CHICKEN_EVENT); - Registry.register(Registries.SOUND_EVENT,CARO_INVICTUS_MUSIC,CARO_INVICTUS_MUSIC_EVENT); + DOLL_SQUEAK = register("item.doll.squeak"); + DOLL_CHICKEN = register("item.doll.chicken"); + CARO_INVICTUS_MUSIC = register("mob.caro_invictus.music"); + EZ_DRONE_TS_SLOWED = register("music.drones.throat_singing_slowed"); //Sound Effect modified from https://pixabay.com/sound-effects/?utm_source=link-attribution&utm_medium=referral&utm_campaign=music&utm_content=86848 + EZ_DRONE_TS_SLOWED_GEIGER = register("music.drones.throat_singing_slowed_geiger"); //Sound Effect from https://pixabay.com/sound-effects/?utm_source=link-attribution&utm_medium=referral&utm_campaign=music&utm_content=86848 and https://pixabay.com/sound-effects/?utm_source=link-attribution&utm_medium=referral&utm_campaign=music&utm_content=62113 + EZ_DRONE_TS_SLOWED_VOICES = register("music.drones.throat_singing_slowed_whispers"); //Sound Effect from https://pixabay.com/sound-effects/?utm_source=link-attribution&utm_medium=referral&utm_campaign=music&utm_content=86848 and https://pixabay.com/sound-effects/?utm_source=link-attribution&utm_medium=referral&utm_campaign=music&utm_content=94457 + } + + public static SoundEvent register(String id) { + Identifier identifier = ExclusionZone.id(id); + SoundEvent soundEvent = SoundEvent.of(identifier); + Registry.register(Registries.SOUND_EVENT,identifier,soundEvent); + return soundEvent; } public static float randPitch() { diff --git a/src/main/resources/assets/exclusionzone/icon.png b/src/main/resources/assets/exclusionzone/icon.png index 047b91f..22d7b23 100644 Binary files a/src/main/resources/assets/exclusionzone/icon.png and b/src/main/resources/assets/exclusionzone/icon.png differ diff --git a/src/main/resources/assets/exclusionzone/sounds.json b/src/main/resources/assets/exclusionzone/sounds.json index 10bce6a..16a0b35 100644 --- a/src/main/resources/assets/exclusionzone/sounds.json +++ b/src/main/resources/assets/exclusionzone/sounds.json @@ -13,7 +13,22 @@ }, "mob.caro_invictus.music": { "sounds": [ - "exclusionzone:mob/caro_invictus/music" + {"name": "exclusionzone:mob/caro_invictus/music", "stream": true, "category": "music"} + ] + }, + "music.drones.throat_singing_slowed": { + "sounds": [ + {"name":"exclusionzone:music/drones/throat_singing_slowed", "stream": true, "category": "music"} + ] + }, + "music.drones.throat_singing_slowed_geiger": { + "sounds": [ + {"name":"exclusionzone:music/drones/throat_singing_slowed_geiger", "stream": true, "category": "music"} + ] + }, + "music.drones.throat_singing_slowed_whispers": { + "sounds": [ + {"name":"exclusionzone:music/drones/throat_singing_slowed_whispers", "stream": true, "category": "music"} ] } } \ No newline at end of file diff --git a/src/main/resources/assets/exclusionzone/sounds/music/drones/throat_singing_slowed.ogg b/src/main/resources/assets/exclusionzone/sounds/music/drones/throat_singing_slowed.ogg new file mode 100644 index 0000000..76f04d8 Binary files /dev/null and b/src/main/resources/assets/exclusionzone/sounds/music/drones/throat_singing_slowed.ogg differ diff --git a/src/main/resources/assets/exclusionzone/sounds/music/drones/throat_singing_slowed_geiger.ogg b/src/main/resources/assets/exclusionzone/sounds/music/drones/throat_singing_slowed_geiger.ogg new file mode 100644 index 0000000..aa3f0e5 Binary files /dev/null and b/src/main/resources/assets/exclusionzone/sounds/music/drones/throat_singing_slowed_geiger.ogg differ diff --git a/src/main/resources/assets/exclusionzone/sounds/music/drones/throat_singing_slowed_whispers.ogg b/src/main/resources/assets/exclusionzone/sounds/music/drones/throat_singing_slowed_whispers.ogg new file mode 100644 index 0000000..02d3386 Binary files /dev/null and b/src/main/resources/assets/exclusionzone/sounds/music/drones/throat_singing_slowed_whispers.ogg differ diff --git a/src/main/resources/data/exclusionzone/worldgen/biome/exclusion_zone.json b/src/main/resources/data/exclusionzone/worldgen/biome/exclusion_zone.json index c66fba2..b069c90 100644 --- a/src/main/resources/data/exclusionzone/worldgen/biome/exclusion_zone.json +++ b/src/main/resources/data/exclusionzone/worldgen/biome/exclusion_zone.json @@ -18,6 +18,13 @@ } } }, + "music": { + "sound": [ + {"sound_id": "exclusionzone:music.drones.throat_singing_slowed","min_delay": 0,"max_delay": 1,"replace_current_music": true}, + {"sound_id": "exclusionzone:music.drones.throat_singing_slowed_geiger","min_delay": 0,"max_delay": 1,"replace_current_music": true}, + {"sound_id": "exclusionzone:music.drones.throat_singing_slowed_whispers","min_delay": 0,"max_delay": 1,"replace_current_music": true} + ] + }, "carvers": { "air": [], "liquid": []