From 2f68d4409acc0e6ada1bf370f8bf4ce5ea83144f Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 6 Feb 2024 16:06:29 +0000 Subject: [PATCH] Add sculk events when the bulb roars and kirin rage --- .../unicopia/ability/magic/spell/RageAbilitySpell.java | 10 ++++++---- .../unicopia/entity/mob/TentacleEntity.java | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/RageAbilitySpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/RageAbilitySpell.java index 70ad08cb..17e3acd8 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/RageAbilitySpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/RageAbilitySpell.java @@ -1,6 +1,7 @@ package com.minelittlepony.unicopia.ability.magic.spell; import com.minelittlepony.unicopia.InteractionManager; +import com.minelittlepony.unicopia.USounds; import com.minelittlepony.unicopia.ability.magic.Caster; import com.minelittlepony.unicopia.ability.magic.spell.effect.*; import com.minelittlepony.unicopia.client.render.PlayerPoser.Animation; @@ -13,11 +14,11 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.entity.damage.DamageTypes; import net.minecraft.nbt.NbtCompound; import net.minecraft.particle.ParticleTypes; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.world.BlockView; import net.minecraft.world.World.ExplosionSourceType; +import net.minecraft.world.event.GameEvent; import net.minecraft.world.explosion.Explosion; import net.minecraft.world.explosion.ExplosionBehavior; @@ -50,7 +51,7 @@ public class RageAbilitySpell extends AbstractSpell { if (source.asEntity().isInsideWaterOrBubbleColumn() || source.asEntity().isFrozen() || ticksToExtenguish > 0) { ticksExtenguishing++; - source.playSound(SoundEvents.ENTITY_GENERIC_EXTINGUISH_FIRE, 1); + source.playSound(USounds.Vanilla.ENTITY_GENERIC_EXTINGUISH_FIRE, 1); source.spawnParticles(ParticleTypes.CLOUD, 12); setDirty(); } else { @@ -79,7 +80,8 @@ public class RageAbilitySpell extends AbstractSpell { if (source instanceof Pony pony) { pony.setAnimation(Animation.ARMS_UP, Recipient.ANYONE, 12); } - source.playSound(SoundEvents.ENTITY_POLAR_BEAR_WARNING, 2F, 0.1F); + source.playSound(USounds.ENTITY_PLAYER_KIRIN_RAGE, 2F, 0.1F); + source.asEntity().emitGameEvent(GameEvent.EXPLODE); } if (source.asEntity().isOnGround() && source.asWorld().isAir(pos) && age % 10 == 0) { @@ -118,7 +120,7 @@ public class RageAbilitySpell extends AbstractSpell { } if (source.asWorld().hasRain(pos.up()) && source.asWorld().random.nextInt(15) == 0) { - source.playSound(SoundEvents.ENTITY_GENERIC_EXTINGUISH_FIRE, 0.3F); + source.playSound(USounds.Vanilla.ENTITY_GENERIC_EXTINGUISH_FIRE, 0.3F); source.spawnParticles(ParticleTypes.CLOUD, 3); } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/mob/TentacleEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/mob/TentacleEntity.java index 16d4a459..9e056950 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/mob/TentacleEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/mob/TentacleEntity.java @@ -35,6 +35,7 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.world.RaycastContext; import net.minecraft.world.World; +import net.minecraft.world.event.GameEvent; public class TentacleEntity extends AbstractDecorationEntity { static final byte ATTACK_STATUS = 54; @@ -152,6 +153,7 @@ public class TentacleEntity extends AbstractDecorationEntity { } addActiveTicks(20 + getWorld().random.nextInt(30)); playSound(USounds.ENTITY_TENTACLE_ROAR, 5, 1); + emitGameEvent(GameEvent.ENTITY_ROAR); return true; } @@ -208,6 +210,7 @@ public class TentacleEntity extends AbstractDecorationEntity { if (growth == 0) { playSound(USounds.ENTITY_TENTACLE_DIG, 1, 1); + emitGameEvent(GameEvent.RESONATE_1); } }