@Override @SideOnly(Side.CLIENT) public void onClientShot( ItemStack weapon, EntityLivingBase shooter, Vec3 position, Vec3 dir, WeaponShot shot) { MOPositionedSound sound = new MOPositionedSound( new ResourceLocation(Reference.MOD_ID + ":" + "plasma_shotgun_shot"), 0.3f + itemRand.nextFloat() * 0.2f, 0.9f + itemRand.nextFloat() * 0.2f); sound.setPosition((float) position.xCoord, (float) position.yCoord, (float) position.zCoord); Minecraft.getMinecraft().getSoundHandler().playDelayedSound(sound, 1); spawnProjectile(weapon, shooter, position, dir, shot); }
@SideOnly(Side.CLIENT) public void playChargingSound(EntityPlayer entityPlayer) { lastChargingSound = new MOPositionedSound( new ResourceLocation(Reference.MOD_ID + ":" + "plasma_shotgun_charging"), 3f + itemRand.nextFloat() * 0.2f, 0.9f * itemRand.nextFloat() * 0.2f); lastChargingSound.setPosition( (float) entityPlayer.posX, (float) entityPlayer.posY, (float) entityPlayer.posZ); Minecraft.getMinecraft().getSoundHandler().playSound(lastChargingSound); }