diff --git a/src/main/java/com/minelittlepony/unicopia/USounds.java b/src/main/java/com/minelittlepony/unicopia/USounds.java index be98d90e..fae2b782 100644 --- a/src/main/java/com/minelittlepony/unicopia/USounds.java +++ b/src/main/java/com/minelittlepony/unicopia/USounds.java @@ -4,19 +4,26 @@ import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvents; import net.minecraft.util.Identifier; import net.minecraft.registry.Registry; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.registry.Registries; -public interface USounds { - SoundEvent AMBIENT_WIND_GUST = register("ambient.wind.gust"); +import static net.minecraft.sound.SoundEvents.*; +public interface USounds { + SoundEvent ENTITY_GENERIC_BUTTER_FINGERS = BLOCK_HONEY_BLOCK_SLIDE; + + SoundEvent ENTITY_PLAYER_CORRUPTION = PARTICLE_SOUL_ESCAPE; SoundEvent ENTITY_PLAYER_BATPONY_SCREECH = register("entity.player.batpony.screech"); SoundEvent ENTITY_PLAYER_REBOUND = register("entity.player.rebound"); SoundEvent ENTITY_PLAYER_PEGASUS_WINGSFLAP = register("entity.player.pegasus.wingsflap"); SoundEvent ENTITY_PLAYER_PEGASUS_FLYING = register("entity.player.pegasus.flying"); SoundEvent ENTITY_PLAYER_PEGASUS_DASH = register("entity.player.pegasus.dash"); SoundEvent ENTITY_PLAYER_PEGASUS_MOLT = register("entity.player.pegasus.molt"); + SoundEvent ENTITY_PLAYER_EARTHPONY_DASH = ENTITY_RAVAGER_STEP; SoundEvent ENTITY_PLAYER_CHANGELING_BUZZ = register("entity.player.changeling.buzz"); SoundEvent ENTITY_PLAYER_CHANGELING_TRANSFORM = register("entity.player.changeling.transform"); + SoundEvent ENTITY_PLAYER_CHANGELING_FEED = ENTITY_GENERIC_DRINK; + SoundEvent ENTITY_PLAYER_CHANGELING_CLIMB = ENTITY_CHICKEN_STEP; SoundEvent ENTITY_PLAYER_UNICORN_TELEPORT = register("entity.player.unicorn.teleport"); SoundEvent ENTITY_PLAYER_EARS_RINGING = register("entity.player.ears_ring"); @@ -39,11 +46,18 @@ public interface USounds { SoundEvent ENTITY_CRYSTAL_HEART_ACTIVATE = register("entity.crystal_heart.activate"); SoundEvent ENTITY_CRYSTAL_HEART_DEACTIVATE = register("entity.crystal_heart.deactivate"); + SoundEvent ENTITY_HOT_AIR_BALLOON_BOOST = ENTITY_GHAST_SHOOT; + SoundEvent ENTITY_HOT_AIR_BALLOON_BURNER_FIRE = ENTITY_GHAST_SHOOT; + SoundEvent ENTITY_HOT_AIR_BALLOON_STEP = BLOCK_WOOL_STEP; + SoundEvent ENTITY_HOT_AIR_BALLOON_BASKET_STEP = BLOCK_BAMBOO_STEP; + SoundEvent ENTITY_HOT_AIR_BALLOON_EQUIP_CANOPY = ITEM_ARMOR_EQUIP_LEATHER; + SoundEvent ENTITY_HOT_AIR_BALLOON_EQUIP_BURNER = ENTITY_IRON_GOLEM_DAMAGE; + SoundEvent ITEM_AMULET_CHARGING = register("item.amulet.charging"); SoundEvent ITEM_AMULET_RECHARGE = register("item.amulet.recharge"); - SoundEvent ITEM_DRAGON_BREATH_SCROLL_USE = SoundEvents.ITEM_FIRECHARGE_USE; - SoundEvent ITEM_DRAGON_BREATH_ARRIVE = SoundEvents.ITEM_FIRECHARGE_USE; + SoundEvent ITEM_DRAGON_BREATH_SCROLL_USE = ITEM_FIRECHARGE_USE; + SoundEvent ITEM_DRAGON_BREATH_ARRIVE = ITEM_FIRECHARGE_USE; SoundEvent ITEM_ICARUS_WINGS_PURIFY = register("item.icarus_wings.resonate"); SoundEvent ITEM_ICARUS_WINGS_CORRUPT = register("item.icarus_wings.corrupted"); @@ -54,12 +68,26 @@ public interface USounds { SoundEvent ITEM_ALICORN_AMULET_HALLUCINATION = register("item.alicorn_amulet.hallucination"); SoundEvent ITEM_ALICORN_AMULET_AMBIENT = register("item.alicorn_amulet.ambient"); + SoundEvent ITEM_GROGAR_BELL_USE = BLOCK_BELL_USE; + SoundEvent ITEM_GROGAR_BELL_STOP_USING = BLOCK_BELL_USE; + SoundEvent ITEM_GROGAR_BELL_CHARGE = BLOCK_BELL_RESONATE; + SoundEvent ITEM_GROGAR_BELL_DRAIN = ENTITY_GUARDIAN_ATTACK; + + SoundEvent ITEM_STAFF_STRIKE = ENTITY_PLAYER_ATTACK_CRIT; + SoundEvent ITEM_MAGIC_STAFF_CHARGE = ENTITY_GUARDIAN_ATTACK; + + SoundEvent ITEM_ROCK_LAND = BLOCK_STONE_HIT; + RegistryEntry.Reference ITEM_MUFFIN_BOUNCE = BLOCK_NOTE_BLOCK_BANJO; + + SoundEvent ITEM_SUNGLASSES_SHATTER = BLOCK_GLASS_BREAK; + SoundEvent ITEM_APPLE_ROT = register("item.apple.rot"); SoundEvent ITEM_BRACELET_SIGN = register("item.bracelet.sign"); SoundEvent ITEM_MAGIC_AURA = register("item.magic.aura"); - SoundEvent BLOCK_WEATHER_VANE_ROTATE = SoundEvents.BLOCK_LANTERN_STEP; - SoundEvent BLOCK_PIE_SLICE = SoundEvents.BLOCK_BEEHIVE_SHEAR; + SoundEvent BLOCK_WEATHER_VANE_ROTATE = BLOCK_LANTERN_STEP; + SoundEvent BLOCK_PIE_SLICE = BLOCK_BEEHIVE_SHEAR; + SoundEvent BLOCK_PIE_SLICE_POP = ENTITY_ITEM_PICKUP; SoundEvent SPELL_CAST_FAIL = register("spell.cast.fail"); SoundEvent SPELL_CAST_SUCCESS = register("spell.cast.success"); @@ -70,17 +98,29 @@ public interface USounds { SoundEvent SPELL_SHIELD_BURN_PROJECTILE = register("spell.shield.projectile.burn"); SoundEvent SPELL_TRANSFORM_TRANSMUTE_ENTITY = register("spell.transform.transmute.entity"); - SoundEvent SPELL_AMBIENT = SoundEvents.BLOCK_BEACON_AMBIENT; - SoundEvent SPELL_MINDSWAP_SWAP = SoundEvents.ENTITY_ZOMBIE_INFECT; - SoundEvent SPELL_MINDSWAP_UNSWAP = SoundEvents.ENTITY_ZOMBIE_VILLAGER_CURE; + SoundEvent SPELL_AMBIENT = BLOCK_BEACON_AMBIENT; + SoundEvent SPELL_MINDSWAP_SWAP = ENTITY_ZOMBIE_INFECT; + SoundEvent SPELL_MINDSWAP_UNSWAP = ENTITY_ZOMBIE_VILLAGER_CURE; - SoundEvent SPELL_DISPLACEMENT_TELEPORT = SoundEvents.ENTITY_HUSK_CONVERTED_TO_ZOMBIE; + SoundEvent SPELL_BUBBLE_DISTURB = BLOCK_HONEY_BLOCK_STEP; + SoundEvent SPELL_FIRE_CRACKLE = BLOCK_FURNACE_FIRE_CRACKLE; + SoundEvent SPELL_NECROMANCY_ACTIVATE = BLOCK_BELL_USE; + + SoundEvent SPELL_DISPLACEMENT_TELEPORT = ENTITY_HUSK_CONVERTED_TO_ZOMBIE; + + SoundEvent ENCHANTMENT_CONSUMPTION_CONSUME = ENTITY_PLAYER_BURP; + + SoundEvent PARTICLE_RAINBOOM_THUNDER = ENTITY_LIGHTNING_BOLT_THUNDER; + SoundEvent PARTICLE_RAINBOOM_REVERB = ENTITY_LIGHTNING_BOLT_THUNDER; + + SoundEvent AMBIENT_WIND_GUST = register("ambient.wind.gust"); SoundEvent AMBIENT_DARK_VORTEX_MOOD = register("ambient.dark_vortex.mood"); SoundEvent AMBIENT_DARK_VORTEX_ADDITIONS = register("ambient.dark_vortex.additions"); SoundEvent GUI_ABILITY_FAIL = register("gui.ability.fail"); SoundEvent GUI_SPELL_CRAFT_SUCCESS = register("gui.spellcraft.success"); + RegistryEntry.Reference GUI_SPELL_EQUIP = UI_BUTTON_CLICK; SoundEvent RECORD_CRUSADE = register("music_disc.crusade"); SoundEvent RECORD_PET = register("music_disc.pet"); @@ -93,4 +133,6 @@ public interface USounds { } static void bootstrap() {} + + static final class Vanilla extends SoundEvents {} } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/BatEeeeAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/BatEeeeAbility.java index fb4269f8..f2ad4e28 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/BatEeeeAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/BatEeeeAbility.java @@ -19,7 +19,6 @@ import com.minelittlepony.unicopia.util.VecHelper; import net.minecraft.entity.LivingEntity; import net.minecraft.particle.ParticleTypes; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.random.Random; @@ -111,7 +110,7 @@ public class BatEeeeAbility implements Ability { if (e.getWorld().random.nextInt(MOB_SPOOK_PROBABILITY) == 0) { RegistryUtils.pickRandom(e.getWorld(), UTags.SPOOKED_MOB_DROPS).ifPresent(drop -> { e.dropStack(drop.getDefaultStack()); - e.playSound(SoundEvents.ENTITY_ITEM_PICKUP, 1, 0.1F); + e.playSound(USounds.Vanilla.ENTITY_ITEM_PICKUP, 1, 0.1F); UCriteria.SPOOK_MOB.trigger(player.asEntity()); }); } diff --git a/src/main/java/com/minelittlepony/unicopia/ability/ChangelingFeedAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/ChangelingFeedAbility.java index 6c71efd3..b491bed3 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/ChangelingFeedAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/ChangelingFeedAbility.java @@ -7,6 +7,7 @@ import java.util.stream.Collectors; import org.jetbrains.annotations.Nullable; import com.minelittlepony.unicopia.Race; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.ability.data.Hit; import com.minelittlepony.unicopia.entity.damage.UDamageTypes; import com.minelittlepony.unicopia.entity.player.Pony; @@ -28,7 +29,6 @@ import net.minecraft.entity.passive.PigEntity; import net.minecraft.entity.passive.SheepEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.particle.ParticleTypes; -import net.minecraft.sound.SoundEvents; /** * Changeling ability to restore health from mobs @@ -122,9 +122,9 @@ public class ChangelingFeedAbility implements Ability { if (!canFeed(iplayer)) { - iplayer.playSound(SoundEvents.ENTITY_PLAYER_BURP, 1, (float)player.getWorld().random.nextTriangular(1F, 0.2F)); + iplayer.playSound(USounds.Vanilla.ENTITY_PLAYER_BURP, 1, (float)player.getWorld().random.nextTriangular(1F, 0.2F)); } else { - iplayer.playSound(SoundEvents.ENTITY_GENERIC_DRINK, 0.1F, iplayer.getRandomPitch()); + iplayer.playSound(USounds.ENTITY_PLAYER_CHANGELING_FEED, 0.1F, iplayer.getRandomPitch()); } return true; diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/BubbleSpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/BubbleSpell.java index 67ca4e09..b64ed22f 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/BubbleSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/BubbleSpell.java @@ -23,7 +23,6 @@ import net.minecraft.entity.attribute.*; import net.minecraft.entity.attribute.EntityAttributeModifier.Operation; import net.minecraft.nbt.NbtCompound; import net.minecraft.particle.ParticleTypes; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; @@ -121,7 +120,7 @@ public class BubbleSpell extends AbstractSpell implements TimedSpell, if (source instanceof Pony pony && pony.sneakingChanged() && pony.asEntity().isSneaking()) { setDirty(); radius += 0.5F; - source.playSound(SoundEvents.BLOCK_HONEY_BLOCK_STEP, 1); + source.playSound(USounds.SPELL_BUBBLE_DISTURB, 1); if (struggles-- <= 0) { setDead(); return false; diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/FireSpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/FireSpell.java index e3675153..8dade44f 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/FireSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/FireSpell.java @@ -1,6 +1,7 @@ package com.minelittlepony.unicopia.ability.magic.spell.effect; import com.minelittlepony.unicopia.EquinePredicates; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.ability.magic.Caster; import com.minelittlepony.unicopia.ability.magic.spell.Situation; import com.minelittlepony.unicopia.ability.magic.spell.AbstractAreaEffectSpell; @@ -24,7 +25,6 @@ import net.minecraft.entity.damage.DamageTypes; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.particle.ParticleTypes; import net.minecraft.sound.SoundCategory; -import net.minecraft.sound.SoundEvents; import net.minecraft.registry.tag.BlockTags; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.EntityHitResult; @@ -166,7 +166,7 @@ public class FireSpell extends AbstractAreaEffectSpell implements ProjectileDele int y = pos.getY(); int z = pos.getZ(); - world.playSound(null, pos, SoundEvents.BLOCK_FURNACE_FIRE_CRACKLE, SoundCategory.AMBIENT, 0.5F, 2.6F + (world.random.nextFloat() - world.random.nextFloat()) * 0.8F); + world.playSound(null, pos, USounds.SPELL_FIRE_CRACKLE, SoundCategory.AMBIENT, 0.5F, 2.6F + (world.random.nextFloat() - world.random.nextFloat()) * 0.8F); for (int i = 0; i < 8; ++i) { ParticleUtils.spawnParticle(world, ParticleTypes.LARGE_SMOKE, new Vec3d( diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/NecromancySpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/NecromancySpell.java index c4e52414..79903e19 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/NecromancySpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/NecromancySpell.java @@ -4,6 +4,7 @@ import java.util.*; import java.util.function.Predicate; import java.util.function.Supplier; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.ability.magic.Caster; import com.minelittlepony.unicopia.ability.magic.spell.AbstractAreaEffectSpell; import com.minelittlepony.unicopia.ability.magic.spell.CastingMethod; @@ -31,7 +32,6 @@ import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtElement; import net.minecraft.nbt.NbtList; import net.minecraft.particle.ParticleTypes; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.math.BlockPos; @@ -185,7 +185,7 @@ public class NecromancySpell extends AbstractAreaEffectSpell implements Projecti minion.setVelocity(0, 0.3, 0); source.asWorld().syncWorldEvent(WorldEvents.DRAGON_BREATH_CLOUD_SPAWNS, minion.getBlockPos(), 0); - source.playSound(SoundEvents.BLOCK_BELL_USE, 1, 0.3F); + source.playSound(USounds.SPELL_NECROMANCY_ACTIVATE, 1, 0.3F); source.spawnParticles(ParticleTypes.LARGE_SMOKE, 10); int level = source.getLevel().get(); diff --git a/src/main/java/com/minelittlepony/unicopia/block/PieBlock.java b/src/main/java/com/minelittlepony/unicopia/block/PieBlock.java index 7c9db33a..b7c2be5b 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/PieBlock.java +++ b/src/main/java/com/minelittlepony/unicopia/block/PieBlock.java @@ -14,7 +14,6 @@ import net.minecraft.fluid.Fluids; import net.minecraft.item.*; import net.minecraft.particle.ParticleTypes; import net.minecraft.sound.SoundCategory; -import net.minecraft.sound.SoundEvents; import net.minecraft.stat.Stats; import net.minecraft.state.StateManager; import net.minecraft.state.property.*; @@ -89,7 +88,7 @@ public class PieBlock extends Block implements Waterloggable { SoundEmitter.playSoundAt(player, USounds.BLOCK_PIE_SLICE, SoundCategory.NEUTRAL, 1, 1); removeSlice(world, pos, state, player); itemStack.damage(1, player, p -> p.sendToolBreakStatus(hand)); - SoundEmitter.playSoundAt(player, SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.NEUTRAL, 0.5F, world.getRandom().nextFloat() * 0.1F + 0.9F); + SoundEmitter.playSoundAt(player, USounds.BLOCK_PIE_SLICE_POP, SoundCategory.NEUTRAL, 0.5F, world.getRandom().nextFloat() * 0.1F + 0.9F); Block.dropStack(world, pos, sliceItem.asItem().getDefaultStack()); return ActionResult.SUCCESS; } @@ -105,10 +104,10 @@ public class PieBlock extends Block implements Waterloggable { player.getHungerManager().add(state.get(STOMPED) ? 1 : 2, 0.1f); world.emitGameEvent(player, GameEvent.EAT, pos); - SoundEmitter.playSoundAt(player, SoundEvents.ENTITY_GENERIC_EAT, 0.5F, world.getRandom().nextFloat() * 0.1F + 0.9F); + SoundEmitter.playSoundAt(player, USounds.Vanilla.ENTITY_GENERIC_EAT, 0.5F, world.getRandom().nextFloat() * 0.1F + 0.9F); if (world instanceof World ww && (!player.canConsume(false) || world.getRandom().nextInt(10) == 0)) { AwaitTickQueue.scheduleTask(ww, w -> { - SoundEmitter.playSoundAt(player, SoundEvents.ENTITY_PLAYER_BURP, 0.5F, world.getRandom().nextFloat() * 0.1F + 0.9F); + SoundEmitter.playSoundAt(player, USounds.Vanilla.ENTITY_PLAYER_BURP, 0.5F, world.getRandom().nextFloat() * 0.1F + 0.9F); }, 5); } diff --git a/src/main/java/com/minelittlepony/unicopia/client/ClientInteractionManager.java b/src/main/java/com/minelittlepony/unicopia/client/ClientInteractionManager.java index 2477ba5c..ec4a26e7 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/ClientInteractionManager.java +++ b/src/main/java/com/minelittlepony/unicopia/client/ClientInteractionManager.java @@ -34,7 +34,6 @@ import net.minecraft.entity.vehicle.AbstractMinecartEntity; import net.minecraft.network.PacketByteBuf; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundCategory; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.Identifier; import net.minecraft.util.math.random.Random; import net.minecraft.world.BlockView; @@ -83,7 +82,7 @@ public class ClientInteractionManager extends InteractionManager { return physics.isFlying() && physics.getFlightType() == FlightType.INSECTOID; }, 0.25F, 0.5F, 0.66F, Random.create(seed))); } else if (type == SOUND_GLIDING && source instanceof PlayerEntity player && isClientPlayer(player)) { - soundManager.play(new MotionBasedSoundInstance<>(SoundEvents.ITEM_ELYTRA_FLYING, player, e -> { + soundManager.play(new MotionBasedSoundInstance<>(USounds.Vanilla.ITEM_ELYTRA_FLYING, player, e -> { Pony pony = Pony.of(e); return pony.getPhysics().isFlying() && pony.getPhysics().getFlightType().isAvian(); }, 0, 1, 1, Random.create(seed))); diff --git a/src/main/java/com/minelittlepony/unicopia/client/KeyBindingsHandler.java b/src/main/java/com/minelittlepony/unicopia/client/KeyBindingsHandler.java index 0bf6bd79..d8c52062 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/KeyBindingsHandler.java +++ b/src/main/java/com/minelittlepony/unicopia/client/KeyBindingsHandler.java @@ -7,6 +7,7 @@ import java.util.Set; import org.lwjgl.glfw.GLFW; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.Unicopia; import com.minelittlepony.unicopia.ability.AbilityDispatcher; import com.minelittlepony.unicopia.ability.AbilitySlot; @@ -18,7 +19,6 @@ import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; import net.minecraft.client.MinecraftClient; import net.minecraft.client.option.KeyBinding; import net.minecraft.client.sound.PositionedSoundInstance; -import net.minecraft.sound.SoundEvents; import net.minecraft.text.Text; import net.minecraft.util.math.MathHelper; @@ -104,7 +104,7 @@ public class KeyBindingsHandler { int page = Unicopia.getConfig().hudPage.get(); page += sigma; Unicopia.getConfig().hudPage.set(page); - client.getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.75F + (0.25F * sigma))); + client.getSoundManager().play(PositionedSoundInstance.master(USounds.Vanilla.UI_BUTTON_CLICK, 1.75F + (0.25F * sigma))); UHud.INSTANCE.setMessage(Text.translatable("gui.unicopia.page_num", page + 1, max + 1)); } diff --git a/src/main/java/com/minelittlepony/unicopia/client/gui/DismissSpellScreen.java b/src/main/java/com/minelittlepony/unicopia/client/gui/DismissSpellScreen.java index 6010d5d2..85709af2 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/gui/DismissSpellScreen.java +++ b/src/main/java/com/minelittlepony/unicopia/client/gui/DismissSpellScreen.java @@ -6,6 +6,7 @@ import java.util.List; import org.joml.Vector4f; import com.minelittlepony.common.client.gui.GameGui; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.ability.magic.spell.*; import com.minelittlepony.unicopia.client.FlowingText; import com.minelittlepony.unicopia.client.render.model.SphereModel; @@ -19,7 +20,6 @@ import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder; import net.minecraft.client.sound.PositionedSoundInstance; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.screen.ScreenTexts; -import net.minecraft.sound.SoundEvents; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.StringHelper; @@ -234,7 +234,7 @@ public class DismissSpellScreen extends GameGui { } static void playClickEffect() { - MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK.value(), 6, 0.3F)); + MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(USounds.Vanilla.UI_BUTTON_CLICK.value(), 6, 0.3F)); } static double squareDistance(double x1, double y1, double x2, double y2) { diff --git a/src/main/java/com/minelittlepony/unicopia/client/gui/UHud.java b/src/main/java/com/minelittlepony/unicopia/client/gui/UHud.java index 3064c46a..a46f23cd 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/gui/UHud.java +++ b/src/main/java/com/minelittlepony/unicopia/client/gui/UHud.java @@ -25,7 +25,6 @@ import net.minecraft.client.gui.hud.InGameHud; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; -import net.minecraft.sound.SoundEvents; import net.minecraft.text.Text; import net.minecraft.util.*; import net.minecraft.util.math.*; @@ -272,7 +271,7 @@ public class UHud { client.getSoundManager().play( partySound = new LoopingSoundInstance<>(client.player, player -> { return UItems.SUNGLASSES.isApplicable(player) || true; - }, SoundEvents.MUSIC_DISC_PIGSTEP, 1, 1, client.world.random) + }, USounds.Vanilla.MUSIC_DISC_PIGSTEP, 1, 1, client.world.random) ); } else if (partySound != null) { partySound.setMuted(false); diff --git a/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookScreen.java b/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookScreen.java index 9949f602..5d319de1 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookScreen.java +++ b/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookScreen.java @@ -9,6 +9,7 @@ import com.minelittlepony.common.client.gui.dimension.Bounds; import com.minelittlepony.common.client.gui.element.Button; import com.minelittlepony.common.client.gui.sprite.TextureSprite; import com.minelittlepony.unicopia.Debug; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.Unicopia; import com.minelittlepony.unicopia.client.gui.*; import com.minelittlepony.unicopia.client.gui.spellbook.SpellbookChapterList.*; @@ -30,7 +31,6 @@ import net.minecraft.client.render.GameRenderer; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.screen.slot.Slot; -import net.minecraft.sound.SoundEvents; import net.minecraft.text.Text; import net.minecraft.util.Identifier; import net.minecraft.util.math.ColorHelper; @@ -223,7 +223,7 @@ public class SpellbookScreen extends HandledScreen imple return tabs.getAllTabs().anyMatch(tab -> { if (tab.bounds().contains(mouseX, mouseY) && chapters.getCurrentChapter() != tab.chapter()) { getState().setCurrentPageId(tab.chapter().id()); - GameGui.playSound(SoundEvents.ITEM_BOOK_PAGE_TURN); + GameGui.playSound(USounds.Vanilla.ITEM_BOOK_PAGE_TURN); clearAndInit(); return true; } diff --git a/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookTraitDexPageContent.java b/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookTraitDexPageContent.java index 368ddaec..50bda09c 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookTraitDexPageContent.java +++ b/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/SpellbookTraitDexPageContent.java @@ -7,6 +7,7 @@ import com.minelittlepony.common.client.gui.*; import com.minelittlepony.common.client.gui.element.Button; import com.minelittlepony.common.client.gui.element.Label; import com.minelittlepony.common.client.gui.sprite.TextureSprite; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.ability.magic.spell.trait.*; import com.minelittlepony.unicopia.client.gui.spellbook.SpellbookChapterList.Chapter; import com.minelittlepony.unicopia.client.gui.spellbook.SpellbookScreen.ImageButton; @@ -19,7 +20,6 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.*; -import net.minecraft.sound.SoundEvents; import net.minecraft.text.Text; import net.minecraft.util.Identifier; import net.minecraft.util.Util; @@ -77,7 +77,7 @@ public class SpellbookTraitDexPageContent implements SpellbookChapterList.Conten leftPage.verticalScrollbar.scrollBy(leftPage.verticalScrollbar.getScrubber().getPosition()); rightPage.verticalScrollbar.scrollBy(rightPage.verticalScrollbar.getScrubber().getPosition()); - GameGui.playSound(SoundEvents.ITEM_BOOK_PAGE_TURN); + GameGui.playSound(USounds.Vanilla.ITEM_BOOK_PAGE_TURN); screen.clearAndInit(); } diff --git a/src/main/java/com/minelittlepony/unicopia/client/particle/LightningBoltParticle.java b/src/main/java/com/minelittlepony/unicopia/client/particle/LightningBoltParticle.java index 89762279..fb62c048 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/particle/LightningBoltParticle.java +++ b/src/main/java/com/minelittlepony/unicopia/client/particle/LightningBoltParticle.java @@ -5,6 +5,7 @@ import java.util.List; import org.joml.Vector3f; +import com.minelittlepony.unicopia.USounds; import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.MinecraftClient; @@ -15,7 +16,6 @@ import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.world.ClientWorld; import net.minecraft.particle.DefaultParticleType; import net.minecraft.sound.SoundCategory; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; @@ -44,7 +44,7 @@ public class LightningBoltParticle extends AbstractGeometryBasedParticle { branches.add(generateBranch()); } - world.playSound(x, y, z, SoundEvents.ENTITY_LIGHTNING_BOLT_THUNDER, SoundCategory.WEATHER, 10000, 8, true); + world.playSound(x, y, z, USounds.Vanilla.ENTITY_LIGHTNING_BOLT_THUNDER, SoundCategory.WEATHER, 10000, 8, true); } world.setLightningTicksLeft(2); diff --git a/src/main/java/com/minelittlepony/unicopia/client/particle/RainboomParticle.java b/src/main/java/com/minelittlepony/unicopia/client/particle/RainboomParticle.java index 22f06bcf..92a81668 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/particle/RainboomParticle.java +++ b/src/main/java/com/minelittlepony/unicopia/client/particle/RainboomParticle.java @@ -1,11 +1,11 @@ package com.minelittlepony.unicopia.client.particle; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.Unicopia; import com.minelittlepony.unicopia.particle.OrientedBillboardParticleEffect; import net.minecraft.client.world.ClientWorld; import net.minecraft.sound.SoundCategory; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.Identifier; import net.minecraft.util.math.MathHelper; @@ -38,8 +38,8 @@ public class RainboomParticle extends OrientedBillboardParticle { baseSize++; if (age == 1) { - world.playSound(x, y, z, SoundEvents.ENTITY_LIGHTNING_BOLT_THUNDER, SoundCategory.AMBIENT, 5, 0.3F, true); - world.playSound(x, y, z, SoundEvents.ENTITY_LIGHTNING_BOLT_THUNDER, SoundCategory.AMBIENT, 10, 1.3F, true); + world.playSound(x, y, z, USounds.PARTICLE_RAINBOOM_THUNDER, SoundCategory.AMBIENT, 5, 0.3F, true); + world.playSound(x, y, z, USounds.PARTICLE_RAINBOOM_REVERB, SoundCategory.AMBIENT, 10, 1.3F, true); } } } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/AirBalloonEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/AirBalloonEntity.java index 90068988..cdd72e22 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/AirBalloonEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/AirBalloonEntity.java @@ -13,7 +13,6 @@ import net.minecraft.item.Items; import net.minecraft.nbt.NbtCompound; import net.minecraft.particle.ParticleTypes; import net.minecraft.registry.RegistryKey; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.util.Identifier; @@ -36,6 +35,7 @@ import java.util.function.Consumer; import java.util.function.IntFunction; import org.jetbrains.annotations.Nullable; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.entity.collision.EntityCollisions; import com.minelittlepony.unicopia.entity.collision.MultiBox; import com.minelittlepony.unicopia.entity.duck.EntityDuck; @@ -213,11 +213,11 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp } if (boosting && !prevBoosting) { - playSound(SoundEvents.ENTITY_GHAST_SHOOT, 1, 1); + playSound(USounds.ENTITY_HOT_AIR_BALLOON_BOOST, 1, 1); } if (isAscending() && age % 15 + rng.nextInt(5) == 0) { - playSound(SoundEvents.ENTITY_GHAST_SHOOT, 0.2F, 1); + playSound(USounds.ENTITY_HOT_AIR_BALLOON_BURNER_FIRE, 0.2F, 1); } if (isLeashed()) { @@ -294,7 +294,7 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp if (getWorld().isClient) { if (e.distanceTraveled > ((EntityDuck)e).getNextStepSoundDistance()) { e.distanceTraveled--; - e.playSound(inBalloon ? SoundEvents.BLOCK_WOOL_STEP : SoundEvents.BLOCK_BAMBOO_STEP, 0.5F, 1); + e.playSound(inBalloon ? USounds.ENTITY_HOT_AIR_BALLOON_STEP : USounds.ENTITY_HOT_AIR_BALLOON_BASKET_STEP, 0.5F, 1); if (!e.isSneaky()) { getWorld().emitGameEvent(e, GameEvent.STEP, getBlockPos()); } @@ -311,10 +311,10 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp if (stack.isOf(Items.FLINT_AND_STEEL)) { setAscending(!isAscending()); if (isAscending()) { - playSound(SoundEvents.ENTITY_GHAST_SHOOT, 1, 1); + playSound(USounds.ENTITY_HOT_AIR_BALLOON_BOOST, 1, 1); } stack.damage(1, player, p -> p.sendEquipmentBreakStatus(hand == Hand.MAIN_HAND ? EquipmentSlot.MAINHAND : EquipmentSlot.OFFHAND)); - playSound(SoundEvents.ITEM_FLINTANDSTEEL_USE, 1, 1); + playSound(USounds.Vanilla.ITEM_FLINTANDSTEEL_USE, 1, 1); getWorld().emitGameEvent(this, GameEvent.ENTITY_INTERACT, getBlockPos()); return ActionResult.SUCCESS; } @@ -343,7 +343,7 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp if (!player.getAbilities().creativeMode) { stack.decrement(1); } - playSound(SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 1, 1); + playSound(USounds.ENTITY_HOT_AIR_BALLOON_EQUIP_CANOPY, 1, 1); getWorld().emitGameEvent(this, GameEvent.ENTITY_INTERACT, getBlockPos()); setDesign(HotAirBalloonItem.getDesign(getWorld(), stack)); return ActionResult.SUCCESS; @@ -354,7 +354,7 @@ public class AirBalloonEntity extends MobEntity implements EntityCollisions.Comp if (!player.getAbilities().creativeMode) { stack.decrement(1); } - playSound(SoundEvents.ENTITY_IRON_GOLEM_DAMAGE, 0.2F, 1); + playSound(USounds.ENTITY_HOT_AIR_BALLOON_EQUIP_BURNER, 0.2F, 1); getWorld().emitGameEvent(this, GameEvent.ENTITY_INTERACT, getBlockPos()); return ActionResult.SUCCESS; } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/Living.java b/src/main/java/com/minelittlepony/unicopia/entity/Living.java index 5679cd66..c6321016 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/Living.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/Living.java @@ -49,7 +49,6 @@ import net.minecraft.network.packet.s2c.play.EntityPassengersSetS2CPacket; import net.minecraft.particle.ParticleTypes; import net.minecraft.registry.tag.DamageTypeTags; import net.minecraft.server.world.ServerWorld; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; @@ -429,7 +428,7 @@ public abstract class Living implements Equine, Caste ItemStack broken = UItems.BROKEN_SUNGLASSES.getDefaultStack(); broken.setNbt(glasses.getNbt()); TrinketsDelegate.getInstance().setEquippedStack(entity, TrinketsDelegate.FACE, broken); - playSound(SoundEvents.BLOCK_GLASS_BREAK, 1, 1); + playSound(USounds.ITEM_SUNGLASSES_SHATTER, 1, 1); } } } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/PhysicsBodyProjectileEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/PhysicsBodyProjectileEntity.java index 30357a43..6ff2aba9 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/PhysicsBodyProjectileEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/PhysicsBodyProjectileEntity.java @@ -2,6 +2,7 @@ package com.minelittlepony.unicopia.entity; import org.jetbrains.annotations.Nullable; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.UTags; import com.minelittlepony.unicopia.ability.magic.Caster; @@ -25,7 +26,6 @@ import net.minecraft.nbt.NbtCompound; import net.minecraft.registry.tag.BlockTags; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvent; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.math.BlockPos; @@ -218,7 +218,7 @@ public class PhysicsBodyProjectileEntity extends PersistentProjectileEntity impl @Override protected SoundEvent getHitSound() { - return isBouncy() ? SoundEvents.BLOCK_NOTE_BLOCK_BANJO.value() : SoundEvents.BLOCK_STONE_HIT; + return isBouncy() ? USounds.ITEM_MUFFIN_BOUNCE.value() : USounds.ITEM_ROCK_LAND; } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/entity/SpellbookEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/SpellbookEntity.java index 28f8be8b..aae8b9fe 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/SpellbookEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/SpellbookEntity.java @@ -1,6 +1,7 @@ package com.minelittlepony.unicopia.entity; import com.minelittlepony.unicopia.EquinePredicates; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.UTags; import com.minelittlepony.unicopia.container.SpellbookScreenHandler; import com.minelittlepony.unicopia.container.SpellbookState; @@ -28,7 +29,6 @@ import net.minecraft.screen.*; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.sound.BlockSoundGroup; import net.minecraft.sound.SoundCategory; -import net.minecraft.sound.SoundEvents; import net.minecraft.text.Text; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; @@ -204,7 +204,7 @@ public class SpellbookEntity extends MobEntity { if (player.isSneaking()) { setForcedState(TriState.of(!isOpen())); keepAwake(); - player.playSound(SoundEvents.ITEM_BOOK_PAGE_TURN, 2, 1); + player.playSound(USounds.Vanilla.ITEM_BOOK_PAGE_TURN, 2, 1); return ActionResult.SUCCESS; } @@ -226,7 +226,7 @@ public class SpellbookEntity extends MobEntity { state.toPacket(buf); } }); - player.playSound(SoundEvents.ITEM_BOOK_PAGE_TURN, 2, 1); + player.playSound(USounds.Vanilla.ITEM_BOOK_PAGE_TURN, 2, 1); return ActionResult.SUCCESS; } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/ChickenBehaviour.java b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/ChickenBehaviour.java index 45eb0668..72d3a1bf 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/ChickenBehaviour.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/ChickenBehaviour.java @@ -1,5 +1,6 @@ package com.minelittlepony.unicopia.entity.behaviour; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.entity.Living; import com.minelittlepony.unicopia.entity.player.Pony; @@ -9,7 +10,6 @@ import net.minecraft.entity.passive.ChickenEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.math.Vec3d; public class ChickenBehaviour extends EntityBehaviour { @@ -34,7 +34,7 @@ public class ChickenBehaviour extends EntityBehaviour { int slot = player.asEntity().getInventory().indexOf(egg); if (slot > -1) { player.asEntity().getInventory().removeStack(slot, 1); - entity.playSound(SoundEvents.ENTITY_CHICKEN_EGG, + entity.playSound(USounds.Vanilla.ENTITY_CHICKEN_EGG, 1, (entity.getWorld().random.nextFloat() - entity.getWorld().random.nextFloat()) * 0.2F + 4 ); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/EntityBehaviour.java b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/EntityBehaviour.java index ef61951a..22127261 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/EntityBehaviour.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/EntityBehaviour.java @@ -5,6 +5,7 @@ import java.util.function.Supplier; import org.jetbrains.annotations.Nullable; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.Unicopia; import com.minelittlepony.unicopia.ability.magic.Caster; import com.minelittlepony.unicopia.compat.pehkui.PehkUtil; @@ -33,7 +34,6 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.projectile.LlamaSpitEntity; import net.minecraft.entity.projectile.thrown.SnowballEntity; import net.minecraft.item.ItemStack; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.registry.Registry; @@ -281,8 +281,8 @@ public class EntityBehaviour { register(GhastBehaviour::new, EntityType.GHAST); register(AxolotlBehaviour::new, EntityType.AXOLOTL); register(EndermanBehaviour::new, EntityType.ENDERMAN); - EntityBehaviour.register(() -> new RangedAttackBehaviour<>(SoundEvents.ENTITY_LLAMA_SPIT, LlamaSpitEntity::new), EntityType.LLAMA, EntityType.TRADER_LLAMA); - EntityBehaviour.register(() -> new RangedAttackBehaviour<>(SoundEvents.ENTITY_SNOW_GOLEM_SHOOT, SnowballEntity::new), EntityType.SNOW_GOLEM); + EntityBehaviour.register(() -> new RangedAttackBehaviour<>(USounds.Vanilla.ENTITY_LLAMA_SPIT, LlamaSpitEntity::new), EntityType.LLAMA, EntityType.TRADER_LLAMA); + EntityBehaviour.register(() -> new RangedAttackBehaviour<>(USounds.Vanilla.ENTITY_SNOW_GOLEM_SHOOT, SnowballEntity::new), EntityType.SNOW_GOLEM); register(SpellcastingIllagerBehaviour::new, EntityType.ILLUSIONER, EntityType.EVOKER); register(ShulkerBehaviour::new, EntityType.SHULKER); register(CreeperBehaviour::new, EntityType.CREEPER); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/SheepBehaviour.java b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/SheepBehaviour.java index 31715fe0..c4074e27 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/SheepBehaviour.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/SheepBehaviour.java @@ -1,5 +1,6 @@ package com.minelittlepony.unicopia.entity.behaviour; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.mixin.MixinSheepEntity; @@ -10,7 +11,6 @@ import net.minecraft.entity.ItemEntity; import net.minecraft.entity.passive.SheepEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemStack; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.random.Random; import net.minecraft.world.WorldEvents; @@ -38,7 +38,7 @@ public class SheepBehaviour extends EntityBehaviour { } else if (!entity.isSheared()) { ItemStack dropType = new ItemStack(MixinSheepEntity.getDrops().get(entity.getColor()).asItem()); - player.asEntity().playSound(SoundEvents.ENTITY_SHEEP_SHEAR, 1, 1); + player.asEntity().playSound(USounds.Vanilla.ENTITY_SHEEP_SHEAR, 1, 1); entity.setSheared(true); Random rng = entity.getWorld().random; diff --git a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/ShulkerBehaviour.java b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/ShulkerBehaviour.java index 7e298723..728d097c 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/ShulkerBehaviour.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/ShulkerBehaviour.java @@ -1,11 +1,11 @@ package com.minelittlepony.unicopia.entity.behaviour; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.entity.Living; import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.mixin.MixinShulkerEntity; import net.minecraft.entity.mob.ShulkerEntity; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction.Axis; @@ -56,7 +56,7 @@ public class ShulkerBehaviour extends EntityBehaviour { } else if (peekAmount > 0.2 && mx.callGetPeekAmount() == 0) { if (shulker.isAlive() && shulker.getWorld().random.nextInt(1000) < shulker.ambientSoundChance++) { shulker.ambientSoundChance = -shulker.getMinAmbientSoundDelay(); - shulker.playSound(SoundEvents.ENTITY_SHULKER_AMBIENT, 1, 1); + shulker.playSound(USounds.Vanilla.ENTITY_SHULKER_AMBIENT, 1, 1); } } } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/TraderBehaviour.java b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/TraderBehaviour.java index e916c0ec..7b9053b8 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/TraderBehaviour.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/TraderBehaviour.java @@ -1,9 +1,9 @@ package com.minelittlepony.unicopia.entity.behaviour; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.entity.player.Pony; import net.minecraft.entity.passive.MerchantEntity; -import net.minecraft.sound.SoundEvents; public class TraderBehaviour extends EntityBehaviour { @Override @@ -12,7 +12,7 @@ public class TraderBehaviour extends EntityBehaviour { entity.setHeadRollingTimeLeft(40); if (!entity.getWorld().isClient()) { - entity.playSound(SoundEvents.ENTITY_VILLAGER_NO, 1, 1); + entity.playSound(USounds.Vanilla.ENTITY_VILLAGER_NO, 1, 1); } } } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/effect/ButterfingersStatusEffect.java b/src/main/java/com/minelittlepony/unicopia/entity/effect/ButterfingersStatusEffect.java index 9231dfc6..8674ee36 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/effect/ButterfingersStatusEffect.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/effect/ButterfingersStatusEffect.java @@ -2,6 +2,8 @@ package com.minelittlepony.unicopia.entity.effect; import org.jetbrains.annotations.Nullable; +import com.minelittlepony.unicopia.USounds; + import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.effect.StatusEffect; @@ -10,7 +12,6 @@ import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemStack; import net.minecraft.network.packet.s2c.play.ScreenHandlerSlotUpdateS2CPacket; import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.Hand; import net.minecraft.util.math.MathHelper; @@ -39,7 +40,7 @@ public class ButterfingersStatusEffect extends StatusEffect { if (target instanceof ServerPlayerEntity player) { if (player.dropSelectedItem(proximity < 1)) { - player.getWorld().playSound(null, player.getBlockPos(), SoundEvents.BLOCK_HONEY_BLOCK_SLIDE, player.getSoundCategory()); + player.getWorld().playSound(null, player.getBlockPos(), USounds.ENTITY_GENERIC_BUTTER_FINGERS, player.getSoundCategory()); PlayerInventory inventory = player.getInventory(); player.networkHandler.sendPacket(new ScreenHandlerSlotUpdateS2CPacket(-2, 0, inventory.selectedSlot, inventory.getStack(inventory.selectedSlot))); } @@ -48,7 +49,7 @@ public class ButterfingersStatusEffect extends StatusEffect { if (!stack.isEmpty()) { target.setStackInHand(Hand.MAIN_HAND, ItemStack.EMPTY); target.dropStack(stack); - target.getWorld().playSound(null, target.getBlockPos(), SoundEvents.BLOCK_HONEY_BLOCK_SLIDE, target.getSoundCategory()); + target.getWorld().playSound(null, target.getBlockPos(), USounds.ENTITY_GENERIC_BUTTER_FINGERS, target.getSoundCategory()); } } } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerCharmTracker.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerCharmTracker.java index b720364b..1f15163d 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerCharmTracker.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerCharmTracker.java @@ -1,6 +1,7 @@ package com.minelittlepony.unicopia.entity.player; import com.google.common.collect.Streams; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.ability.magic.spell.effect.CustomisedSpellType; import com.minelittlepony.unicopia.ability.magic.spell.effect.SpellType; import com.minelittlepony.unicopia.item.EnchantableItem; @@ -9,7 +10,6 @@ import com.minelittlepony.unicopia.util.NbtSerialisable; import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtElement; import net.minecraft.nbt.NbtList; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.Hand; import net.minecraft.util.TypedActionResult; @@ -52,7 +52,7 @@ public class PlayerCharmTracker implements NbtSerialisable { public void equipSpell(Hand hand, CustomisedSpellType spell) { handSpells[hand.ordinal()] = spell; - pony.asEntity().playSound(SoundEvents.UI_BUTTON_CLICK.value(), 0.25F, 1.75F); + pony.asEntity().playSound(USounds.GUI_SPELL_EQUIP.value(), 0.25F, 1.75F); pony.setDirty(); } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java index 26d3a9fc..b10ee952 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java @@ -32,6 +32,7 @@ import net.minecraft.entity.EntityPose; import net.minecraft.entity.EntityType; import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.LightningEntity; +import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.damage.DamageSource; import net.minecraft.item.ItemStack; @@ -40,7 +41,6 @@ import net.minecraft.particle.ParticleTypes; import net.minecraft.predicate.entity.EntityPredicates; import net.minecraft.registry.RegistryKeys; import net.minecraft.sound.SoundCategory; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.math.*; import net.minecraft.world.dimension.DimensionType; import net.minecraft.world.event.GameEvent; @@ -584,7 +584,8 @@ public class PlayerPhysics extends EntityPhysics implements Tickab velocity.fromImmutable(entity.getVelocity()); distance /= bouncyness; } else { - entity.playSound(distance > 4 ? SoundEvents.ENTITY_PLAYER_BIG_FALL : SoundEvents.ENTITY_PLAYER_SMALL_FALL, 1, entity.getSoundPitch()); + LivingEntity.FallSounds fallSounds = entity.getFallSounds(); + entity.playSound(distance > 4 ? fallSounds.big() : fallSounds.small(), 1, entity.getSoundPitch()); } entity.damage(entity.getDamageSources().flyIntoWall(), distance); } @@ -756,7 +757,7 @@ public class PlayerPhysics extends EntityPhysics implements Tickab if (isFlying()) { pony.playSound(USounds.ENTITY_PLAYER_PEGASUS_DASH, 1); } else { - pony.playSound(SoundEvents.ENTITY_RAVAGER_STEP, 2, 0.3F); + pony.playSound(USounds.ENTITY_PLAYER_EARTHPONY_DASH, 2, 0.3F); } } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java index ec534ebe..08373931 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java @@ -54,7 +54,6 @@ import net.minecraft.nbt.NbtCompound; import net.minecraft.registry.tag.DamageTypeTags; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; -import net.minecraft.sound.SoundEvents; import net.minecraft.text.Text; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; @@ -115,8 +114,8 @@ public class Pony extends Living implements Copyable, Update public Pony(PlayerEntity player) { super(player, EFFECT); - this.levels = new PlayerLevelStore(this, LEVEL, true, SoundEvents.ENTITY_PLAYER_LEVELUP); - this.corruption = new PlayerLevelStore(this, CORRUPTION, false, SoundEvents.PARTICLE_SOUL_ESCAPE); + this.levels = new PlayerLevelStore(this, LEVEL, true, USounds.Vanilla.ENTITY_PLAYER_LEVELUP); + this.corruption = new PlayerLevelStore(this, CORRUPTION, false, USounds.ENTITY_PLAYER_CORRUPTION); this.mana = addTicker(new ManaContainer(this)); player.getDataTracker().startTracking(RACE, Race.DEFAULT_ID); @@ -394,7 +393,7 @@ public class Pony extends Living implements Copyable, Update if (distanceClimbed > 1.5) { if (vel.length() > 0.08F && entity.age % (3 + entity.getRandom().nextInt(5)) == 0) { - entity.playSound(SoundEvents.ENTITY_CHICKEN_STEP, + entity.playSound(USounds.ENTITY_PLAYER_CHANGELING_CLIMB, (float)entity.getRandom().nextTriangular(0.5, 0.3), entity.getSoundPitch() ); diff --git a/src/main/java/com/minelittlepony/unicopia/item/BellItem.java b/src/main/java/com/minelittlepony/unicopia/item/BellItem.java index ed16331d..3c0cdbe0 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/BellItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/BellItem.java @@ -4,6 +4,7 @@ import java.util.List; import org.jetbrains.annotations.Nullable; import com.minelittlepony.unicopia.Race; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.entity.Creature; import com.minelittlepony.unicopia.entity.Living; import com.minelittlepony.unicopia.entity.damage.UDamageTypes; @@ -24,7 +25,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.particle.ParticleEffect; import net.minecraft.particle.ParticleTypes; -import net.minecraft.sound.SoundEvents; import net.minecraft.text.Text; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; @@ -58,7 +58,7 @@ public class BellItem extends Item implements ChargeableItem { player.setCurrentHand(hand); Pony pony = Pony.of(player); pony.getCorruption().add(1); - pony.playSound(SoundEvents.BLOCK_BELL_USE, 0.4F, 0.2F); + pony.playSound(USounds.ITEM_GROGAR_BELL_USE, 0.4F, 0.2F); Living targetLiving = target instanceof MobEntity || target instanceof PlayerEntity ? Living.getOrEmpty(target) .filter(living -> !(living instanceof Creature c && c.isDiscorded())) .orElse(null) : null; @@ -78,7 +78,7 @@ public class BellItem extends Item implements ChargeableItem { Pony pony = Pony.of(player); if (hasCharge(stack)) { - pony.playSound(SoundEvents.BLOCK_BELL_RESONATE, 0.6F, 1); + pony.playSound(USounds.ITEM_GROGAR_BELL_CHARGE, 0.6F, 1); pony.getCorruption().add(1); if (offhandStack.getItem() instanceof ChargeableItem chargeable) { float maxChargeBy = chargeable.getMaxCharge() - ChargeableItem.getEnergy(offhandStack); @@ -97,7 +97,7 @@ public class BellItem extends Item implements ChargeableItem { return TypedActionResult.consume(stack); } - pony.playSound(SoundEvents.BLOCK_BELL_USE, 0.01F, 0.9F); + pony.playSound(USounds.ITEM_GROGAR_BELL_USE, 0.01F, 0.9F); return TypedActionResult.consume(stack); } @@ -121,7 +121,7 @@ public class BellItem extends Item implements ChargeableItem { private void onStoppedDraining(Living user, Living target, boolean completed) { user.setTarget(null); - user.playSound(SoundEvents.BLOCK_BELL_USE, 0.2F, 0.3F); + user.playSound(USounds.ITEM_GROGAR_BELL_STOP_USING, 0.2F, 0.3F); if (target instanceof Creature creature && (completed || target.asEntity().getHealth() < (target.asEntity().getMaxHealth() * 0.5F) + 1)) { creature.setDiscorded(true); } @@ -170,7 +170,7 @@ public class BellItem extends Item implements ChargeableItem { } ChargeableItem.consumeEnergy(stack, -amountDrawn); - user.playSound(SoundEvents.ENTITY_GUARDIAN_ATTACK, 0.2F, progress); + user.playSound(USounds.ITEM_GROGAR_BELL_DRAIN, 0.2F, progress); for (int i = 0; i < 4; i++) { living.addParticle( diff --git a/src/main/java/com/minelittlepony/unicopia/item/EnchantedStaffItem.java b/src/main/java/com/minelittlepony/unicopia/item/EnchantedStaffItem.java index 4d729704..5cbbe6e7 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/EnchantedStaffItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/EnchantedStaffItem.java @@ -7,6 +7,7 @@ import java.util.stream.Stream; import javax.annotation.Nullable; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.ability.magic.Caster; import com.minelittlepony.unicopia.ability.magic.SpellPredicate; import com.minelittlepony.unicopia.ability.magic.spell.CastingMethod; @@ -27,7 +28,6 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.particle.ParticleTypes; import net.minecraft.sound.SoundCategory; -import net.minecraft.sound.SoundEvents; import net.minecraft.text.Text; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; @@ -177,7 +177,7 @@ public class EnchantedStaffItem extends StaffItem implements EnchantableItem, Ch (world.random.nextGaussian() - 0.5) / 10, (world.random.nextGaussian() - 0.5) / 10 ); - world.playSound(null, entity.getBlockPos(), SoundEvents.ENTITY_GUARDIAN_ATTACK, SoundCategory.PLAYERS, 1, i / 20); + world.playSound(null, entity.getBlockPos(), USounds.ITEM_MAGIC_STAFF_CHARGE, SoundCategory.PLAYERS, 1, i / 20); if (i > 200) { living.clearActiveItem(); diff --git a/src/main/java/com/minelittlepony/unicopia/item/PineappleItem.java b/src/main/java/com/minelittlepony/unicopia/item/PineappleItem.java index d9bca4b7..7098e7a4 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/PineappleItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/PineappleItem.java @@ -1,6 +1,7 @@ package com.minelittlepony.unicopia.item; import com.minelittlepony.unicopia.AwaitTickQueue; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.UTags; import com.minelittlepony.unicopia.util.RegistryUtils; @@ -9,7 +10,6 @@ import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.sound.SoundCategory; -import net.minecraft.sound.SoundEvents; import net.minecraft.world.World; public class PineappleItem extends Item { @@ -24,7 +24,7 @@ public class PineappleItem extends Item { if (!world.isClient) { stack.damage(1, user, u -> { AwaitTickQueue.scheduleTask(u.getWorld(), w -> { - w.playSoundFromEntity(null, u, SoundEvents.ENTITY_PLAYER_BURP, SoundCategory.PLAYERS, 1, 0.7F); + w.playSoundFromEntity(null, u, USounds.Vanilla.ENTITY_PLAYER_BURP, SoundCategory.PLAYERS, 1, 0.7F); }); }); diff --git a/src/main/java/com/minelittlepony/unicopia/item/StaffItem.java b/src/main/java/com/minelittlepony/unicopia/item/StaffItem.java index a9febf20..3edfe731 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/StaffItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/StaffItem.java @@ -5,6 +5,7 @@ import java.util.UUID; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.entity.UEntityAttributes; import net.minecraft.block.Blocks; @@ -22,7 +23,6 @@ import net.minecraft.item.SwordItem; import net.minecraft.item.ToolMaterials; import net.minecraft.particle.BlockStateParticleEffect; import net.minecraft.particle.ParticleTypes; -import net.minecraft.sound.SoundEvents; import net.minecraft.text.Text; import net.minecraft.util.ActionResult; import net.minecraft.util.Formatting; @@ -70,7 +70,7 @@ public class StaffItem extends SwordItem { } protected boolean castContainedEffect(ItemStack stack, LivingEntity target, LivingEntity attacker) { - target.getEntityWorld().playSound(null, target.getBlockPos(), SoundEvents.ENTITY_PLAYER_ATTACK_CRIT, attacker.getSoundCategory(), 1, 1); + target.getEntityWorld().playSound(null, target.getBlockPos(), USounds.ITEM_STAFF_STRIKE, attacker.getSoundCategory(), 1, 1); target.takeKnockback(attacker.getVelocity().subtract(target.getVelocity()).horizontalLength(), MathHelper.sin(attacker.getYaw() * 0.017453292F), diff --git a/src/main/java/com/minelittlepony/unicopia/item/enchantment/ConsumptionEnchantment.java b/src/main/java/com/minelittlepony/unicopia/item/enchantment/ConsumptionEnchantment.java index a59a797a..547710c0 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/enchantment/ConsumptionEnchantment.java +++ b/src/main/java/com/minelittlepony/unicopia/item/enchantment/ConsumptionEnchantment.java @@ -4,6 +4,7 @@ import java.util.function.DoubleSupplier; import org.jetbrains.annotations.Nullable; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.advancement.UCriteria; import com.minelittlepony.unicopia.util.VecHelper; @@ -17,7 +18,6 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.item.ItemStack; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundCategory; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; @@ -43,7 +43,7 @@ public class ConsumptionEnchantment extends SimpleEnchantment { DoubleSupplier vecComponentFactory = () -> world.random.nextTriangular(0, 0.3); Block.getDroppedStacks(state, world, pos, blockEntity, entity, tool).forEach(s -> { - world.playSound(null, pos, SoundEvents.ENTITY_PLAYER_BURP, SoundCategory.BLOCKS, 0.05F, (float)world.random.nextTriangular(0.6F, 0.2F)); + world.playSound(null, pos, USounds.ENCHANTMENT_CONSUMPTION_CONSUME, SoundCategory.BLOCKS, 0.05F, (float)world.random.nextTriangular(0.6F, 0.2F)); ExperienceOrbEntity.spawn(world, Vec3d.ofCenter(pos).add(VecHelper.supply(vecComponentFactory)), s.getCount()); UCriteria.USE_CONSUMPTION.trigger(entity); }); diff --git a/src/main/java/com/minelittlepony/unicopia/server/world/ZapAppleStageStore.java b/src/main/java/com/minelittlepony/unicopia/server/world/ZapAppleStageStore.java index 547a8c31..c90bc2af 100644 --- a/src/main/java/com/minelittlepony/unicopia/server/world/ZapAppleStageStore.java +++ b/src/main/java/com/minelittlepony/unicopia/server/world/ZapAppleStageStore.java @@ -3,6 +3,7 @@ package com.minelittlepony.unicopia.server.world; import java.util.Locale; import java.util.stream.StreamSupport; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.Unicopia; import com.minelittlepony.unicopia.block.UBlocks; import com.minelittlepony.unicopia.block.ZapAppleLeavesBlock; @@ -15,7 +16,6 @@ import net.minecraft.entity.EntityType; import net.minecraft.entity.LightningEntity; import net.minecraft.nbt.*; import net.minecraft.sound.SoundCategory; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.Identifier; import net.minecraft.util.StringIdentifiable; import net.minecraft.util.math.BlockPos; @@ -91,7 +91,7 @@ public class ZapAppleStageStore extends PersistentState implements Tickable { playedMoonEffect = true; markDirty(); - world.playSound(null, pos.getX(), pos.getY(), pos.getZ(), SoundEvents.ENTITY_WOLF_HOWL, SoundCategory.BLOCKS, 1.5F, 0.3F, world.random.nextInt(1200)); + world.playSound(null, pos.getX(), pos.getY(), pos.getZ(), USounds.Vanilla.ENTITY_WOLF_HOWL, SoundCategory.BLOCKS, 1.5F, 0.3F, world.random.nextInt(1200)); } }