Skip to content

Commit

Permalink
Popping sound when player pick ups a morph
Browse files Browse the repository at this point in the history
  • Loading branch information
mchorse committed Nov 28, 2016
1 parent 2746036 commit 48d25be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/mchorse/metamorph/api/actions/Teleport.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ public void execute(EntityPlayer player)
double y = block.getY() + 1.0F;
double z = block.getZ() + 0.5F;

player.worldObj.playSound((EntityPlayer) null, player.prevPosX, player.prevPosY, player.prevPosZ, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.HOSTILE, 1.0F, 1.0F);
player.worldObj.playSound(null, player.prevPosX, player.prevPosY, player.prevPosZ, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.HOSTILE, 1.0F, 1.0F);
player.setPositionAndUpdate(x, y, z);
player.resetCooldown();
player.worldObj.playSound((EntityPlayer) null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.HOSTILE, 1.0F, 1.0F);
player.worldObj.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.HOSTILE, 1.0F, 1.0F);
}
}
}
3 changes: 1 addition & 2 deletions src/main/java/mchorse/metamorph/api/morph/Morph.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,10 @@ public void attack(Entity target, EntityPlayer player)
public void morph(EntityPlayer player)
{
this.setHealth(player, this.health);
player.playSound(SoundEvents.ENTITY_ITEM_PICKUP, 1.0F, 1.0F);

for (IAbility ability : this.abilities)
{
player.playSound(SoundEvents.ENTITY_ITEM_PICKUP, 1.0F, 1.0F);

ability.onMorph(player);
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/mchorse/metamorph/entity/EntityMorph.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.SoundEvents;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.ByteBufUtils;
Expand Down Expand Up @@ -141,6 +143,7 @@ private void grantMorph()
{
Dispatcher.sendTo(new PacketAcquireMorph(morph), (EntityPlayerMP) player);

this.worldObj.playSound(null, this.posX, this.posY, this.posZ, SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.AMBIENT, 1.0F, 1.0F);
}
}

Expand Down

0 comments on commit 48d25be

Please sign in to comment.