diff --git a/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e b/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e new file mode 100644 index 00000000..159fd36c --- /dev/null +++ b/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e @@ -0,0 +1,2 @@ +// 1.20.1 2024-06-08T15:08:38.1949414 Sound Definitions +33424544e6cf49e7ad5d1a6a9bc815d66be63114 assets/exdeorum/sounds.json diff --git a/src/generated/resources/.cache/93943142017732f21fbc4fa325d116c728b69767 b/src/generated/resources/.cache/93943142017732f21fbc4fa325d116c728b69767 index 44f37764..4e6941bf 100644 --- a/src/generated/resources/.cache/93943142017732f21fbc4fa325d116c728b69767 +++ b/src/generated/resources/.cache/93943142017732f21fbc4fa325d116c728b69767 @@ -1,2 +1,2 @@ -// 1.20.1 2024-06-08T13:01:18.8550278 ModKit Language: en_us for mod 'exdeorum' -471aa53a5fdaafa9b4b4e2e4c8d72341afd6c154 assets/exdeorum/lang/en_us.json +// 1.20.1 2024-06-08T15:07:39.710396 ModKit Language: en_us for mod 'exdeorum' +dc59643415839f9885be6e0755e50db35134152b assets/exdeorum/lang/en_us.json diff --git a/src/generated/resources/assets/exdeorum/lang/en_us.json b/src/generated/resources/assets/exdeorum/lang/en_us.json index b6839cde..aca450e2 100644 --- a/src/generated/resources/assets/exdeorum/lang/en_us.json +++ b/src/generated/resources/assets/exdeorum/lang/en_us.json @@ -275,7 +275,7 @@ "item.exdeorum.porcelain_water_bucket": "Porcelain Water Bucket", "item.exdeorum.porcelain_witch_water_bucket": "Porcelain Witch Water Bucket", "item.exdeorum.random_armor_trim": "Random Armor Trim", - "item.exdeorum.random_armor_trim.no_upgrade": "Note: Does not drop Netherite Upgrade template", + "item.exdeorum.random_armor_trim.no_upgrade": "Does not drop Netherite Upgrade", "item.exdeorum.random_pottery_sherd": "Random Pottery Sherd", "item.exdeorum.sculk_core": "Sculk Core", "item.exdeorum.silk_worm": "Silk Worm", @@ -297,6 +297,17 @@ "item.exdeorum.wooden_watering_can": "Wooden Watering Can", "item.exdeorum.zinc_ore_chunk": "Zinc Ore Chunk", "itemGroup.exdeorum.main": "Ex Deorum", + "subtitles.exdeorum.barrel.add_compost": "Added barrel compost", + "subtitles.exdeorum.barrel.compost_finish": "Barrel compost finished", + "subtitles.exdeorum.barrel.fluid_transform": "Mechanical Hammer", + "subtitles.exdeorum.barrel.mixing_finish": "Barrel mixing finished", + "subtitles.exdeorum.grass_seeds.place": "Mechanical Hammer", + "subtitles.exdeorum.sculk_core.activate": "Mechanical Hammer", + "subtitles.exdeorum.silk_worm.drop": "Mechanical Hammer", + "subtitles.exdeorum.silk_worm.eat": "Mechanical Hammer", + "subtitles.exdeorum.silk_worm.infest": "Mechanical Hammer", + "subtitles.exdeorum.watering_can.stop": "Mechanical Hammer", + "subtitles.exdeorum.watering_can.use": "Mechanical Hammer", "tag.item.exdeorum.barrels": "Barrels", "tag.item.exdeorum.compressed.andesite": "Compressed Andesite", "tag.item.exdeorum.compressed.blackstone": "Compressed Blackstone", diff --git a/src/generated/resources/assets/exdeorum/sounds.json b/src/generated/resources/assets/exdeorum/sounds.json new file mode 100644 index 00000000..2f21d04f --- /dev/null +++ b/src/generated/resources/assets/exdeorum/sounds.json @@ -0,0 +1,106 @@ +{ + "barrel_add_compost": { + "sounds": [ + "block/composter/fill1", + "block/composter/fill2", + "block/composter/fill3", + "block/composter/fill4" + ], + "subtitle": "subtitles.exdeorum.barrel.add_compost" + }, + "barrel_compost_finish": { + "sounds": [ + "block/composter/ready1", + "block/composter/ready2", + "block/composter/ready3", + "block/composter/ready4" + ], + "subtitle": "subtitles.exdeorum.barrel.compost_finish" + }, + "barrel_fluid_transform": { + "sounds": [ + "block/brewing_stand/brew1", + "block/brewing_stand/brew2" + ], + "subtitle": "subtitles.exdeorum.barrel.fluid_transform" + }, + "barrel_mixing": { + "sounds": [ + "exdeorum:block/barrel/mix1", + "exdeorum:block/barrel/mix2", + "exdeorum:block/barrel/mix3" + ], + "subtitle": "subtitles.exdeorum.barrel.mixing_finish" + }, + "grass_seeds_place": { + "sounds": [ + "block/rooted_dirt/break1", + "block/rooted_dirt/break2", + "block/rooted_dirt/break3", + "block/rooted_dirt/break4" + ], + "subtitle": "subtitles.exdeorum.grass_seeds.place" + }, + "sculk_core_activate": { + "sounds": [ + "block/sculk_shrieker/shriek1", + "block/sculk_shrieker/shriek2", + "block/sculk_shrieker/shriek3", + "block/sculk_shrieker/shriek4", + "block/sculk_shrieker/shriek5" + ], + "subtitle": "subtitles.exdeorum.sculk_core.activate" + }, + "silk_worm_drop": { + "sounds": [ + "block/honeyblock/break1", + "block/honeyblock/break2", + "block/honeyblock/break3", + "block/honeyblock/break4", + "block/honeyblock/break5" + ], + "subtitle": "subtitles.exdeorum.silk_worm.drop" + }, + "silk_worm_eat": { + "sounds": [ + "block/roots/break1", + "block/roots/break2", + "block/roots/break3", + "block/roots/break4", + "block/roots/break5", + "block/roots/break6" + ], + "subtitle": "subtitles.exdeorum.silk_worm.eat" + }, + "silk_worm_infest": { + "sounds": [ + "block/honeyblock/break1", + "block/honeyblock/break2", + "block/honeyblock/break3", + "block/honeyblock/break4", + "block/honeyblock/break5" + ], + "subtitle": "subtitles.exdeorum.silk_worm.infest" + }, + "watering_can_stop": { + "sounds": [ + "item/bucket/fill1", + "item/bucket/fill2", + "item/bucket/fill3" + ], + "subtitle": "subtitles.exdeorum.watering_can.stop" + }, + "watering_can_use": { + "sounds": [ + "ambient/weather/rain1", + "ambient/weather/rain2", + "ambient/weather/rain3", + "ambient/weather/rain4", + "ambient/weather/rain5", + "ambient/weather/rain6", + "ambient/weather/rain7", + "ambient/weather/rain8" + ], + "subtitle": "subtitles.exdeorum.watering_can.use" + } +} \ No newline at end of file diff --git a/src/main/java/thedarkcolour/exdeorum/ExDeorum.java b/src/main/java/thedarkcolour/exdeorum/ExDeorum.java index a7ad79a2..6c754f72 100644 --- a/src/main/java/thedarkcolour/exdeorum/ExDeorum.java +++ b/src/main/java/thedarkcolour/exdeorum/ExDeorum.java @@ -76,6 +76,7 @@ public class ExDeorum { EGlobalLootModifiers.GLOBAL_LOOT_MODIFIERS.register(modBus); EItems.ITEMS.register(modBus); ELootFunctions.LOOT_FUNCTIONS.register(modBus); + ESounds.SOUNDS.register(modBus); EMenus.MENUS.register(modBus); ERecipeSerializers.RECIPE_SERIALIZERS.register(modBus); ERecipeTypes.RECIPE_TYPES.register(modBus); diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/BarrelBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/BarrelBlockEntity.java index 9c7a2620..750f3acc 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/BarrelBlockEntity.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/BarrelBlockEntity.java @@ -65,6 +65,7 @@ import thedarkcolour.exdeorum.recipe.RecipeUtil; import thedarkcolour.exdeorum.recipe.barrel.BarrelFluidMixingRecipe; import thedarkcolour.exdeorum.recipe.barrel.FluidTransformationRecipe; import thedarkcolour.exdeorum.registry.EBlockEntities; +import thedarkcolour.exdeorum.registry.ESounds; public class BarrelBlockEntity extends EBlockEntity { private static final int MOSS_SPREAD_RANGE = 2; @@ -94,7 +95,7 @@ public class BarrelBlockEntity extends EBlockEntity { } @Override - public LazyOptional getCapability(Capability cap, Direction side) { + public LazyOptional getCapability(Capability cap, @Nullable Direction side) { if (cap == ForgeCapabilities.FLUID_HANDLER) { return this.fluidHandler.cast(); } else if (cap == ForgeCapabilities.ITEM_HANDLER) { @@ -383,7 +384,7 @@ public class BarrelBlockEntity extends EBlockEntity { ItemStack result = new ItemStack(recipe.result); result.setTag(recipe.getResultNbt()); setItem(result); - this.level.playSound(null, this.worldPosition, SoundEvents.AMBIENT_UNDERWATER_EXIT, SoundSource.BLOCKS, 0.8f, 0.8f); + this.level.playSound(null, this.worldPosition, ESounds.BARREL_MIXING.get(), SoundSource.BLOCKS, 0.8f, 1.0f); } // Mixing was successful, so return true return true; @@ -424,7 +425,7 @@ public class BarrelBlockEntity extends EBlockEntity { this.b = (short) (weightNew * color.z + weightOld * this.b); } - this.level.playSound(null, this.worldPosition, SoundEvents.COMPOSTER_FILL, SoundSource.BLOCKS); + this.level.playSound(null, this.worldPosition, ESounds.BARREL_ADD_COMPOST.get(), SoundSource.BLOCKS); } /** @@ -534,7 +535,7 @@ public class BarrelBlockEntity extends EBlockEntity { if (barrel.progress >= 1.0f - Mth.EPSILON) { // Reset progress barrel.progress = 0.0f; - level.playSound(null, pos, SoundEvents.BREWING_STAND_BREW, SoundSource.BLOCKS, 1.0f, 0.6f); + level.playSound(null, pos, ESounds.BARREL_FLUID_TRANSFORM.get(), SoundSource.BLOCKS, 1.0f, 0.6f); tank.setFluid(FluidStack.EMPTY); tank.fill(new FluidStack(recipe.resultFluid, 1000), IFluidHandler.FluidAction.EXECUTE); } @@ -591,7 +592,7 @@ public class BarrelBlockEntity extends EBlockEntity { this.progress = 0.0f; this.compost = 0; setItem(new ItemStack(Items.DIRT)); - this.level.playSound(null, this.worldPosition, SoundEvents.COMPOSTER_READY, SoundSource.BLOCKS); + this.level.playSound(null, this.worldPosition, ESounds.BARREL_COMPOST.get(), SoundSource.BLOCKS); } } diff --git a/src/main/java/thedarkcolour/exdeorum/data/Data.java b/src/main/java/thedarkcolour/exdeorum/data/Data.java index c7561d51..bbe0b6a4 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/Data.java +++ b/src/main/java/thedarkcolour/exdeorum/data/Data.java @@ -59,5 +59,6 @@ public class Data { gen.addProvider(true, new LootTables(output)); gen.addProvider(true, new Advancements(output, lookup, helper)); + gen.addProvider(true, new Sounds(output, helper)); } } diff --git a/src/main/java/thedarkcolour/exdeorum/data/English.java b/src/main/java/thedarkcolour/exdeorum/data/English.java index 6390558b..7bf38725 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/English.java +++ b/src/main/java/thedarkcolour/exdeorum/data/English.java @@ -59,6 +59,8 @@ class English { english.add(TranslationKeys.INFESTED_LEAVES_FULLY_INFESTED, "Fully Infested"); + english.add(TranslationKeys.RANDOM_TRIM_DOES_NOT_CONTAIN_UPGRADE, "Does not drop Netherite Upgrade"); + english.add(TranslationKeys.ROOT_ADVANCEMENT_TITLE, "Don't Look Down..."); english.add(TranslationKeys.ROOT_ADVANCEMENT_DESCRIPTION, "Spawn into a SkyBlock void world"); english.add(TranslationKeys.CROOK_ADVANCEMENT_TITLE, "Give Him The Hook"); @@ -112,6 +114,18 @@ class English { english.add(TranslationKeys.REDSTONE_CONTROL_MODE, "Mode: "); english.add(TranslationKeys.MECHANICAL_HAMMER_SCREEN_TITLE, "Mechanical Hammer"); + english.add(TranslationKeys.BARREL_ADD_COMPOST_SUBTITLE, "Added barrel compost"); + english.add(TranslationKeys.BARREL_COMPOST_SUBTITLE, "Barrel compost finished"); + english.add(TranslationKeys.BARREL_MIXING_SUBTITLE, "Barrel mixing finished"); + english.add(TranslationKeys.BARREL_FLUID_TRANSFORM_SUBTITLE, "Mechanical Hammer"); + english.add(TranslationKeys.SILK_WORM_DROP_SUBTITLE, "Mechanical Hammer"); + english.add(TranslationKeys.SILK_WORM_INFEST_SUBTITLE, "Mechanical Hammer"); + english.add(TranslationKeys.SILK_WORM_EAT_SUBTITLE, "Mechanical Hammer"); + english.add(TranslationKeys.GRASS_SEEDS_PLACE_SUBTITLE, "Mechanical Hammer"); + english.add(TranslationKeys.SCULK_CORE_ACTIVATE_SUBTITLE, "Mechanical Hammer"); + english.add(TranslationKeys.WATERING_CAN_USE_SUBTITLE, "Mechanical Hammer"); + english.add(TranslationKeys.WATERING_CAN_STOP_SUBTITLE, "Mechanical Hammer"); + english.add(DefaultMaterials.VEXING_ARCHWOOD_CRUCIBLE.getBlock(), "Vexing Archwood Crucible"); english.add(DefaultMaterials.CASCADING_ARCHWOOD_CRUCIBLE.getBlock(), "Cascading Archwood Crucible"); english.add(DefaultMaterials.BLAZING_ARCHWOOD_CRUCIBLE.getBlock(), "Blazing Archwood Crucible"); diff --git a/src/main/java/thedarkcolour/exdeorum/data/Sounds.java b/src/main/java/thedarkcolour/exdeorum/data/Sounds.java new file mode 100644 index 00000000..42584849 --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/data/Sounds.java @@ -0,0 +1,56 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package thedarkcolour.exdeorum.data; + +import net.minecraft.data.PackOutput; +import net.minecraftforge.common.data.ExistingFileHelper; +import net.minecraftforge.common.data.SoundDefinition; +import net.minecraftforge.common.data.SoundDefinitionsProvider; +import thedarkcolour.exdeorum.ExDeorum; +import thedarkcolour.exdeorum.registry.ESounds; + +class Sounds extends SoundDefinitionsProvider { + protected Sounds(PackOutput output, ExistingFileHelper helper) { + super(output, ExDeorum.ID, helper); + } + + @Override + public void registerSounds() { + add(ESounds.BARREL_ADD_COMPOST.getId(), withVariations(TranslationKeys.BARREL_ADD_COMPOST_SUBTITLE, "block/composter/fill", 4)); + add(ESounds.BARREL_COMPOST.getId(), withVariations(TranslationKeys.BARREL_COMPOST_SUBTITLE, "block/composter/ready", 4)); + add(ESounds.BARREL_MIXING.getId(), withVariations(TranslationKeys.BARREL_MIXING_SUBTITLE, ExDeorum.ID + ":block/barrel/mix", 3)); + add(ESounds.BARREL_FLUID_TRANSFORM.getId(), withVariations(TranslationKeys.BARREL_FLUID_TRANSFORM_SUBTITLE, "block/brewing_stand/brew", 2)); + add(ESounds.SILK_WORM_DROP.getId(), withVariations(TranslationKeys.SILK_WORM_DROP_SUBTITLE, "block/honeyblock/break", 5)); + add(ESounds.SILK_WORM_INFEST.getId(), withVariations(TranslationKeys.SILK_WORM_INFEST_SUBTITLE, "block/honeyblock/break", 5)); + add(ESounds.SILK_WORM_EAT.getId(), withVariations(TranslationKeys.SILK_WORM_EAT_SUBTITLE, "block/roots/break", 6)); + add(ESounds.GRASS_SEEDS_PLACE.getId(), withVariations(TranslationKeys.GRASS_SEEDS_PLACE_SUBTITLE, "block/rooted_dirt/break", 4)); + add(ESounds.SCULK_CORE_ACTIVATE.getId(), withVariations(TranslationKeys.SCULK_CORE_ACTIVATE_SUBTITLE, "block/sculk_shrieker/shriek", 5)); + add(ESounds.WATERING_CAN_USE.getId(), withVariations(TranslationKeys.WATERING_CAN_USE_SUBTITLE, "ambient/weather/rain", 8)); + add(ESounds.WATERING_CAN_STOP.getId(), withVariations(TranslationKeys.WATERING_CAN_STOP_SUBTITLE, "item/bucket/fill", 3)); + } + + private static SoundDefinition withVariations(String subtitleKey, String baseSoundPath, int variations) { + var definition = definition().subtitle(subtitleKey); + for (int i = 1; i <= variations; i++) { + definition.with(sound(baseSoundPath + i)); + } + + return definition; + } +} diff --git a/src/main/java/thedarkcolour/exdeorum/data/TranslationKeys.java b/src/main/java/thedarkcolour/exdeorum/data/TranslationKeys.java index 5db6e42e..9c63e5f6 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/TranslationKeys.java +++ b/src/main/java/thedarkcolour/exdeorum/data/TranslationKeys.java @@ -86,7 +86,7 @@ public class TranslationKeys { // Screens public static final String MECHANICAL_SIEVE_SCREEN_TITLE = ExDeorum.ID + ".container.mechanical_sieve"; - public static final String[] REDSTONE_CONTROL_MODES = new String[] { + public static final String[] REDSTONE_CONTROL_MODES = new String[]{ "gui." + ExDeorum.ID + ".redstone_control.always", "gui." + ExDeorum.ID + ".redstone_control.unpowered", "gui." + ExDeorum.ID + ".redstone_control.powered" @@ -94,4 +94,17 @@ public class TranslationKeys { public static final String REDSTONE_CONTROL_LABEL = "gui." + ExDeorum.ID + ".redstone_control.label"; public static final String REDSTONE_CONTROL_MODE = "gui." + ExDeorum.ID + ".redstone_control.mode"; public static final String MECHANICAL_HAMMER_SCREEN_TITLE = ExDeorum.ID + ".container.mechanical_hammer"; + + // Sounds + public static final String BARREL_ADD_COMPOST_SUBTITLE = "subtitles.exdeorum.barrel.add_compost"; + public static final String BARREL_COMPOST_SUBTITLE = "subtitles.exdeorum.barrel.compost_finish"; + public static final String BARREL_MIXING_SUBTITLE = "subtitles.exdeorum.barrel.mixing_finish"; + public static final String BARREL_FLUID_TRANSFORM_SUBTITLE = "subtitles.exdeorum.barrel.fluid_transform"; + public static final String SILK_WORM_DROP_SUBTITLE = "subtitles.exdeorum.silk_worm.drop"; + public static final String SILK_WORM_INFEST_SUBTITLE = "subtitles.exdeorum.silk_worm.infest"; + public static final String SILK_WORM_EAT_SUBTITLE = "subtitles.exdeorum.silk_worm.eat"; + public static final String GRASS_SEEDS_PLACE_SUBTITLE = "subtitles.exdeorum.grass_seeds.place"; + public static final String SCULK_CORE_ACTIVATE_SUBTITLE = "subtitles.exdeorum.sculk_core.activate"; + public static final String WATERING_CAN_USE_SUBTITLE = "subtitles.exdeorum.watering_can.use"; + public static final String WATERING_CAN_STOP_SUBTITLE = "subtitles.exdeorum.watering_can.stop"; } diff --git a/src/main/java/thedarkcolour/exdeorum/item/CookedSilkWormItem.java b/src/main/java/thedarkcolour/exdeorum/item/CookedSilkWormItem.java index 7b7f0cbc..43bca500 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/CookedSilkWormItem.java +++ b/src/main/java/thedarkcolour/exdeorum/item/CookedSilkWormItem.java @@ -19,8 +19,8 @@ package thedarkcolour.exdeorum.item; import net.minecraft.sounds.SoundEvent; -import net.minecraft.sounds.SoundEvents; import net.minecraft.world.item.Item; +import thedarkcolour.exdeorum.registry.ESounds; public class CookedSilkWormItem extends Item { public CookedSilkWormItem(Properties properties) { @@ -30,6 +30,6 @@ public class CookedSilkWormItem extends Item { // Yummy silk worms :) @Override public SoundEvent getEatingSound() { - return SoundEvents.WEEPING_VINES_PLACE; + return ESounds.SILK_WORM_EAT.get(); } } diff --git a/src/main/java/thedarkcolour/exdeorum/item/GrassSpreaderItem.java b/src/main/java/thedarkcolour/exdeorum/item/GrassSpreaderItem.java index 039decb5..8f953f60 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/GrassSpreaderItem.java +++ b/src/main/java/thedarkcolour/exdeorum/item/GrassSpreaderItem.java @@ -34,6 +34,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.block.state.BlockState; import thedarkcolour.exdeorum.registry.EItems; +import thedarkcolour.exdeorum.registry.ESounds; import java.util.function.Supplier; @@ -56,7 +57,7 @@ public class GrassSpreaderItem extends Item { if (canSpread(state) && grass != state) { if (!level.isClientSide) { level.setBlock(pos, grass, 3); - level.playSound(null, pos, SoundEvents.ROOTED_DIRT_PLACE, SoundSource.BLOCKS); + level.playSound(null, pos, ESounds.GRASS_SEEDS_PLACE.get(), SoundSource.BLOCKS); if (player == null || !player.getAbilities().instabuild) { ctx.getItemInHand().shrink(1); @@ -97,8 +98,9 @@ public class GrassSpreaderItem extends Item { mushroomCow.setInvulnerable(cow.isInvulnerable()); cow.level().addFreshEntity(mushroomCow); - if (!cow.level().isClientSide) + if (!cow.level().isClientSide) { ((ServerLevel)cow.level()).sendParticles(ParticleTypes.EXPLOSION, cow.getX(), cow.getY(0.5D), cow.getZ(), 1, 0.0D, 0.0D, 0.0D, 0.0D); + } cow.playSound(SoundEvents.MOOSHROOM_CONVERT, 2.0F, 1.0F); } diff --git a/src/main/java/thedarkcolour/exdeorum/item/SculkCoreItem.java b/src/main/java/thedarkcolour/exdeorum/item/SculkCoreItem.java index ee10eb45..b81fe4a0 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/SculkCoreItem.java +++ b/src/main/java/thedarkcolour/exdeorum/item/SculkCoreItem.java @@ -19,7 +19,6 @@ package thedarkcolour.exdeorum.item; import net.minecraft.core.particles.ParticleTypes; -import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.world.InteractionResult; import net.minecraft.world.item.Item; @@ -27,6 +26,7 @@ import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.SculkShriekerBlock; import org.joml.Math; +import thedarkcolour.exdeorum.registry.ESounds; public class SculkCoreItem extends Item { public SculkCoreItem(Properties properties) { @@ -59,7 +59,7 @@ public class SculkCoreItem extends Item { } } } - level.playSound(null, pos, SoundEvents.SCULK_SHRIEKER_SHRIEK, SoundSource.BLOCKS, 1.0f, 1.0f); + level.playSound(null, pos, ESounds.SCULK_CORE_ACTIVATE.get(), SoundSource.BLOCKS, 1.0f, 1.0f); return InteractionResult.sidedSuccess(level.isClientSide); } diff --git a/src/main/java/thedarkcolour/exdeorum/item/SilkWormItem.java b/src/main/java/thedarkcolour/exdeorum/item/SilkWormItem.java index 75a0a672..ebbc89c6 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/SilkWormItem.java +++ b/src/main/java/thedarkcolour/exdeorum/item/SilkWormItem.java @@ -18,7 +18,6 @@ package thedarkcolour.exdeorum.item; -import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.tags.BlockTags; import net.minecraft.world.InteractionResult; @@ -29,6 +28,7 @@ import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.block.LeavesBlock; import thedarkcolour.exdeorum.blockentity.InfestedLeavesBlockEntity; import thedarkcolour.exdeorum.registry.EBlocks; +import thedarkcolour.exdeorum.registry.ESounds; public class SilkWormItem extends Item { public SilkWormItem(Item.Properties properties) { @@ -49,7 +49,7 @@ public class SilkWormItem extends Item { .setValue(LeavesBlock.DISTANCE, state.getValue(LeavesBlock.DISTANCE)) .setValue(LeavesBlock.PERSISTENT, state.getValue(LeavesBlock.PERSISTENT)), 2); - level.playSound(null, pos, SoundEvents.HONEY_BLOCK_HIT, SoundSource.BLOCKS); + level.playSound(null, pos, ESounds.SILK_WORM_INFEST.get(), SoundSource.BLOCKS); // Set mimic if (level.getBlockEntity(pos) instanceof InfestedLeavesBlockEntity leaves) { @@ -69,7 +69,7 @@ public class SilkWormItem extends Item { public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) { // play a gross noise when you discover a silk worm if (entity.tickCount == 1 && entity.getOwner() == null) { - entity.level().playSound(null, entity, SoundEvents.HONEY_BLOCK_PLACE, SoundSource.BLOCKS, 1.0f, 1.0f); + entity.level().playSound(null, entity, ESounds.SILK_WORM_DROP.get(), SoundSource.BLOCKS, 1.0f, 1.0f); } return false; } diff --git a/src/main/java/thedarkcolour/exdeorum/item/WateringCanItem.java b/src/main/java/thedarkcolour/exdeorum/item/WateringCanItem.java index a7ac8c9d..92c782ec 100644 --- a/src/main/java/thedarkcolour/exdeorum/item/WateringCanItem.java +++ b/src/main/java/thedarkcolour/exdeorum/item/WateringCanItem.java @@ -28,7 +28,6 @@ import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.server.level.ServerLevel; -import net.minecraft.sounds.SoundEvents; import net.minecraft.tags.BlockTags; import net.minecraft.util.Mth; import net.minecraft.world.InteractionHand; @@ -63,6 +62,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import thedarkcolour.exdeorum.blockentity.BarrelBlockEntity; import thedarkcolour.exdeorum.data.TranslationKeys; +import thedarkcolour.exdeorum.registry.ESounds; import thedarkcolour.exdeorum.tag.EBlockTags; import java.util.List; @@ -203,7 +203,7 @@ public class WateringCanItem extends Item { waterParticles(level, pos, state); } if ((useTicks - STARTUP_TIME) % 20 == 0) { - level.playSound(null, pos, SoundEvents.WEATHER_RAIN, living.getSoundSource(), this.getClass() == WideWateringCanItem.class ? 0.6f : 0.3f, 1.5f); + level.playSound(null, pos, ESounds.WATERING_CAN_USE.get(), living.getSoundSource(), this.getClass() == WideWateringCanItem.class ? 0.6f : 0.3f, 1.5f); } } else { isWatering = true; @@ -222,7 +222,7 @@ public class WateringCanItem extends Item { @Override public void releaseUsing(ItemStack stack, Level level, LivingEntity living, int timeCharged) { if (timeCharged > STARTUP_TIME) { - level.playLocalSound(living.getX(), living.getY(), living.getZ(), SoundEvents.BUCKET_FILL, living.getSoundSource(), 0.6f, 0.7f, false); + level.playLocalSound(living.getX(), living.getY(), living.getZ(), ESounds.WATERING_CAN_STOP.get(), living.getSoundSource(), 0.6f, 0.7f, false); } } diff --git a/src/main/java/thedarkcolour/exdeorum/registry/EItems.java b/src/main/java/thedarkcolour/exdeorum/registry/EItems.java index fa673d53..b83e1282 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/EItems.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/EItems.java @@ -38,7 +38,7 @@ import java.util.List; public class EItems { public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, ExDeorum.ID); - // Silk Worm + // Silk Worm (todo rename to "silkworm" in 1.21) public static final RegistryObject SILK_WORM = ITEMS.register("silk_worm", () -> new SilkWormItem(props())); public static final RegistryObject COOKED_SILK_WORM = ITEMS.register("cooked_silk_worm", () -> new CookedSilkWormItem(props().food(new FoodProperties.Builder().nutrition(2).saturationMod(0.6f).build()))); diff --git a/src/main/java/thedarkcolour/exdeorum/registry/ESounds.java b/src/main/java/thedarkcolour/exdeorum/registry/ESounds.java new file mode 100644 index 00000000..2eb4696b --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/registry/ESounds.java @@ -0,0 +1,59 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package thedarkcolour.exdeorum.registry; + +import net.minecraft.core.registries.Registries; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.sounds.SoundEvents; +import net.minecraftforge.registries.DeferredRegister; +import net.minecraftforge.registries.RegistryObject; +import thedarkcolour.exdeorum.ExDeorum; + +import java.util.function.Supplier; + +// These sounds are all copies of vanilla sounds, just with their own names so players can easily muffle them +public class ESounds { + public static final DeferredRegister SOUNDS = DeferredRegister.create(Registries.SOUND_EVENT, ExDeorum.ID); + + // original sound: SoundEvents.COMPOSTER_FILL + public static final RegistryObject BARREL_ADD_COMPOST = SOUNDS.register("barrel_add_compost", () -> SoundEvent.createVariableRangeEvent(ESounds.BARREL_ADD_COMPOST.getId())); + // original sound: SoundEvents.COMPOSTER_READY + public static final RegistryObject BARREL_COMPOST = SOUNDS.register("barrel_compost_finish", () -> SoundEvent.createVariableRangeEvent(ESounds.BARREL_COMPOST.getId())); + // original sound: SoundEvents.AMBIENT_UNDERWATER_EXIT + public static final RegistryObject BARREL_MIXING = SOUNDS.register("barrel_mixing", () -> SoundEvent.createVariableRangeEvent(ESounds.BARREL_MIXING.getId())); + // original sound: SoundEvents.BREWING_STAND_BREW + public static final RegistryObject BARREL_FLUID_TRANSFORM = SOUNDS.register("barrel_fluid_transform", () -> SoundEvent.createVariableRangeEvent(ESounds.BARREL_FLUID_TRANSFORM.getId())); + + // original sound: SoundEvents.HONEY_BLOCK_PLACE + public static final RegistryObject SILK_WORM_DROP = SOUNDS.register("silk_worm_drop", () -> SoundEvent.createVariableRangeEvent(ESounds.SILK_WORM_DROP.getId())); + // original sound: SoundEvents.HONEY_BLOCK_HIT + public static final RegistryObject SILK_WORM_INFEST = SOUNDS.register("silk_worm_infest", () -> SoundEvent.createVariableRangeEvent(ESounds.SILK_WORM_INFEST.getId())); + // original sound: SoundEvents.WEEPING_VINES_PLACE + public static final RegistryObject SILK_WORM_EAT = SOUNDS.register("silk_worm_eat", () -> SoundEvent.createVariableRangeEvent(ESounds.SILK_WORM_EAT.getId())); + + // original sound: SoundEvents.ROOTED_DIRT_PLACE + public static final RegistryObject GRASS_SEEDS_PLACE = SOUNDS.register("grass_seeds_place", () -> SoundEvent.createVariableRangeEvent(ESounds.GRASS_SEEDS_PLACE.getId())); + // original sound: SoundEvents.SCULK_SHRIEKER_SHRIEK + public static final RegistryObject SCULK_CORE_ACTIVATE = SOUNDS.register("sculk_core_activate", () -> SoundEvent.createVariableRangeEvent(ESounds.SCULK_CORE_ACTIVATE.getId())); + + // original sound: SoundEvents.WEATHER_RAIN + public static final RegistryObject WATERING_CAN_USE = SOUNDS.register("watering_can_use", () -> SoundEvent.createVariableRangeEvent(ESounds.WATERING_CAN_USE.getId())); + // original sound: SoundEvents.BUCKET_FILL + public static final RegistryObject WATERING_CAN_STOP = SOUNDS.register("watering_can_stop", () -> SoundEvent.createVariableRangeEvent(ESounds.WATERING_CAN_STOP.getId())); +} diff --git a/src/main/resources/assets/exdeorum/sounds/block/barrel/mix1.ogg b/src/main/resources/assets/exdeorum/sounds/block/barrel/mix1.ogg new file mode 100644 index 00000000..2cd87c23 Binary files /dev/null and b/src/main/resources/assets/exdeorum/sounds/block/barrel/mix1.ogg differ diff --git a/src/main/resources/assets/exdeorum/sounds/block/barrel/mix2.ogg b/src/main/resources/assets/exdeorum/sounds/block/barrel/mix2.ogg new file mode 100644 index 00000000..c75f5438 Binary files /dev/null and b/src/main/resources/assets/exdeorum/sounds/block/barrel/mix2.ogg differ diff --git a/src/main/resources/assets/exdeorum/sounds/block/barrel/mix3.ogg b/src/main/resources/assets/exdeorum/sounds/block/barrel/mix3.ogg new file mode 100644 index 00000000..942a8503 Binary files /dev/null and b/src/main/resources/assets/exdeorum/sounds/block/barrel/mix3.ogg differ